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
book_id | location_id | checked_out_version |
---|---|---|
12 | 1 | 10 |
15 | 1 | 12 |
12 | 2 | 0 |
66 | 1 | 0 |
INSERT 0 4
PREPARE
book_id | location_id | checked_out_version | book_id | loc_id | ver |
---|---|---|---|---|---|
12 | 1 | 11 | 12 | 1 | 11 |
15 | 1 | 20 | 15 | 1 | 20 |
UPDATE 2
book_id | location_id | checked_out_version |
---|---|---|
12 | 2 | 0 |
66 | 1 | 0 |
12 | 1 | 11 |
15 | 1 | 20 |
SELECT 4