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?.
date | quarter |
---|---|
2021-01-01 00:00:00 | 2020-12-01 00:00:00 |
2021-02-01 00:00:00 | 2020-12-01 00:00:00 |
2021-03-01 00:00:00 | 2021-03-01 00:00:00 |
2021-04-01 00:00:00 | 2021-03-01 00:00:00 |
2021-05-01 00:00:00 | 2021-03-01 00:00:00 |
2021-06-01 00:00:00 | 2021-06-01 00:00:00 |
2021-07-01 00:00:00 | 2021-06-01 00:00:00 |
2021-08-01 00:00:00 | 2021-06-01 00:00:00 |
2021-09-01 00:00:00 | 2021-09-01 00:00:00 |
2021-10-01 00:00:00 | 2021-09-01 00:00:00 |
2021-11-01 00:00:00 | 2021-09-01 00:00:00 |
2021-12-01 00:00:00 | 2021-12-01 00:00:00 |
SELECT 12