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 6
Product | Plant | Store | start_date | start_stock | en_date | end_stock |
---|---|---|---|---|---|---|
789123 | B345 | 123 | 2001-01-01 | 10 | 2001-01-16 | 30 |
123456 | A123 | Z12 | 2001-01-01 | 20 | 2001-01-16 | -20 |
SELECT 2