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?.
CREATE TABLE
INSERT 0 40
ad_id | ct |
---|---|
396 | 1 |
900 | 3 |
816 | 3 |
843 | 2 |
510 | 1 |
302 | 2 |
288 | 4 |
721 | 4 |
956 | 1 |
804 | 1 |
823 | 1 |
526 | 2 |
467 | 2 |
523 | 2 |
533 | 4 |
62 | 1 |
463 | 1 |
880 | 2 |
750 | 2 |
742 | 1 |
SELECT 20
ct | ct_ct |
---|---|
1 | 8 |
2 | 7 |
3 | 2 |
4 | 3 |
SELECT 4