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 7
CREATE TABLE
INSERT 0 3
station_id | value | date |
---|---|---|
001 | 10 | 2014-01-01 |
001 | null | 2014-01-02 |
001 | 30 | 2014-01-03 |
001 | null | 2014-01-04 |
002 | 40 | 2014-01-01 |
002 | null | 2014-01-02 |
002 | null | 2014-01-03 |
002 | null | 2014-01-04 |
003 | 20 | 2014-01-01 |
003 | null | 2014-01-02 |
003 | null | 2014-01-03 |
003 | null | 2014-01-04 |
SELECT 12