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?.
SELECT 4
timestamp | item | quantity | account | sum |
---|---|---|---|---|
2024-01-01 01:00:10 | 1245 | 10 | a | 10 |
2024-01-01 04:00:10 | 1245 | 20 | b | 30 |
2024-01-01 05:00:10 | 1245 | 300 | a | 320 |
2024-01-01 07:00:10 | 1111 | 30 | a | 30 |
SELECT 4