By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
6 rows affected
ts | foo_id | bar_id |
---|---|---|
1612344312 | foo_id_1 | bar_id_1 |
1612344311 | foo_id_1 | bar_id_1 |
1612344310 | foo_id_2 | bar_id_1 |
1612344309 | foo_id_2 | bar_id_1 |
1612344308 | foo_id_3 | bar_id_2 |
1612344307 | foo_id_3 | bar_id_2 |
bar_id | count | avg |
---|---|---|
bar_id_1 | 2 | 1.00000000000000000000 |
bar_id_2 | 1 | 1.00000000000000000000 |