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 10
SELECT 5
date | location_id | score |
---|---|---|
2019-01-01 00:00:00+00 | 100 | 5.0 |
2019-01-02 00:00:00+00 | 100 | 5.0 |
2019-01-03 00:00:00+00 | 100 | 5.0 |
2019-01-04 00:00:00+00 | 100 | 5.0 |
2019-01-05 00:00:00+00 | 100 | 6.2 |
2019-01-03 00:00:00+00 | 200 | 10 |
2019-01-04 00:00:00+00 | 200 | 10 |
2019-01-05 00:00:00+00 | 200 | 10 |
2019-01-06 00:00:00+00 | 200 | 10 |
2019-01-07 00:00:00+00 | 200 | 10 |
2019-01-08 00:00:00+00 | 200 | 10 |
2019-01-09 00:00:00+00 | 200 | 11 |
SELECT 12