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
INSERT 0 27
CREATE PROCEDURE
CALL
year | month | Delivered | Not Delivered | Not Received |
---|---|---|---|---|
2021 | August | 1 | 1 | 2 |
2022 | August | 2 | null | null |
2022 | December | null | null | 2 |
2021 | February | null | null | 1 |
2020 | January | 1 | 1 | 1 |
2021 | January | 1 | 2 | 1 |
2020 | March | 2 | 2 | null |
2021 | March | 1 | null | null |
2022 | November | 2 | 3 | 1 |
SELECT 9