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 1
emp_id | name | dept |
---|---|---|
1 | John | Sales |
SELECT 1
MERGE 2
emp_id | name | dept |
---|---|---|
1 | John | IT |
2 | Jack | Sales |
SELECT 2