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
CREATE TABLE
INSERT 0 4
INSERT 0 7
customer_id | date | amount |
---|---|---|
1 | 2020-01-29 | 10 |
1 | 2020-03-14 | 60 |
2 | 2020-04-05 | 180 |
2 | 2020-03-20 | 110 |
SELECT 4