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 8
id | date | value_1 | value_2 |
---|---|---|---|
1 | 2022-01-04 | 5 | asdf |
1 | 2022-01-03 | null | null |
1 | 2022-01-02 | null | def |
1 | 2022-01-01 | 4 | null |
2 | 2022-01-04 | 1 | a |
2 | 2022-01-03 | null | null |
2 | 2022-01-02 | 2 | b |
2 | 2021-12-31 | null | null |
SELECT 8
id | date | value_1 | value_2 |
---|---|---|---|
1 | 2022-01-04 | 5 | asdf |
1 | 2022-01-03 | 4 | def |
1 | 2022-01-02 | 4 | def |
1 | 2022-01-01 | 4 | null |
2 | 2022-01-04 | 1 | a |
2 | 2022-01-03 | 2 | b |
2 | 2022-01-02 | 2 | b |
2 | 2021-12-31 | null | null |
SELECT 8
UPDATE 4
UPDATE 4
id | date | value_1 | value_2 |
---|---|---|---|
1 | 2022-01-04 | 5 | asdf |
1 | 2022-01-03 | 4 | def |
1 | 2022-01-02 | 4 | def |
1 | 2022-01-01 | 4 | null |
2 | 2022-01-04 | 1 | a |
2 | 2022-01-03 | 2 | b |
2 | 2022-01-02 | 2 | b |
2 | 2021-12-31 | null | null |
SELECT 8