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?.
version |
---|
PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit |
SELECT 1
CREATE TABLE
INSERT 0 4
id | direct_ancestor_id | first_in_chain_id | level | ancestor_level |
---|---|---|---|---|
f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | 0 | 0 |
56643607-fb5e-42e7-9fc3-8d699d27e6eb | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | 1 | 0 |
2782aed3-6518-40af-b39f-412309715142 | 56643607-fb5e-42e7-9fc3-8d699d27e6eb | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | 2 | 1 |
2b20c21c-ae4b-41f3-b62e-36bd28ef1516 | 2782aed3-6518-40af-b39f-412309715142 | f6f4e818-6eb7-4d3b-9f14-badc5f7f53ea | 3 | 2 |
SELECT 4
DELETE 4
id | direct_ancestor_id | first_in_chain_id | level | ancestor_level |
---|
SELECT 0