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?.
DROP TABLE
CREATE TABLE
INSERT 0 3
month | count |
---|---|
2018-01-01 | 2 |
2018-02-01 | 2 |
2018-03-01 | 2 |
2018-04-01 | 2 |
2018-05-01 | 2 |
2018-06-01 | 2 |
2018-07-01 | 2 |
2018-08-01 | 2 |
2018-09-01 | 2 |
2018-10-01 | 2 |
2018-11-01 | 2 |
2018-12-01 | 2 |
2019-01-01 | 2 |
2019-02-01 | 3 |
2019-03-01 | 3 |
2019-04-01 | 3 |
2019-05-01 | 3 |
2019-06-01 | 3 |
2019-07-01 | 3 |
2019-08-01 | 3 |
2019-09-01 | 3 |
2019-10-01 | 3 |
2019-11-01 | 3 |
2019-12-01 | 3 |
2020-01-01 | 3 |
2020-02-01 | 2 |
2020-03-01 | 2 |
2020-04-01 | 2 |
2020-05-01 | 2 |
2020-06-01 | 2 |
2020-07-01 | 2 |
2020-08-01 | 1 |
2020-09-01 | 1 |
2020-10-01 | 1 |
2020-11-01 | 1 |
2020-12-01 | 1 |
SELECT 36