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 3
empid | dept_no | join_date | termination_date | id |
---|---|---|---|---|
1001 | 11 | 2020-01-01 00:00:00 | 2020-02-01 00:00:00 | 183 |
1001 | 12 | 2020-02-02 00:00:00 | 2020-04-01 00:00:00 | 182 |
1001 | 11 | 2020-04-02 00:00:00 | null | 186 |
SELECT 3
UPDATE 2
empid | dept_no | join_date | termination_date | id |
---|---|---|---|---|
1001 | 11 | 2020-01-01 00:00:00 | 2020-02-01 00:00:00 | 183 |
1001 | 12 | 2020-02-01 00:00:00 | 2020-04-01 00:00:00 | 182 |
1001 | 11 | 2020-04-01 00:00:00 | null | 186 |
SELECT 3