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 2
CREATE TABLE
INSERT 0 2
CREATE FUNCTION
pool | spa | house_size | sauna | no_rooms |
---|---|---|---|---|
1 | 1 | 1 | 25 | 0 |
1 | 0 | 1 | 35 | 0 |
SELECT 2
pool | spa | house_size | sauna | no_rooms |
---|---|---|---|---|
1 | 1 | 1 | 25 | 2 |
1 | 0 | 1 | 35 | 3 |
SELECT 2
pool | has_spa | sauna | house_size | rooms |
---|---|---|---|---|
1 | 1 | 25 | 1 | 0 |
1 | 0 | 35 | 1 | 0 |
SELECT 2