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 5
payment_id | amount | category | category_total |
---|---|---|---|
1 | 5 | action | 8 |
3 | 2 | action | 8 |
5 | 1 | action | 8 |
4 | 6 | drama | 6 |
2 | 10 | horror | 10 |
SELECT 5