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
CREATE FUNCTION
CREATE FUNCTION
id | created_at | login | password | init_index | parent_id | |
---|---|---|---|---|---|---|
1 | 2022-10-30 18:51:15.711518+00 | 873431C2BB | EA77031FC64FF7697AF9 | null | null | null |
2 | 2022-10-30 18:51:15.711518+00 | E90C1EFCC6 | 51164A31E3FC002E8776 | null | null | null |
3 | 2022-10-30 18:51:15.711518+00 | F465A8896D | 68BA64B12EC3B7B25309 | null | null | null |
4 | 2022-10-30 18:51:15.711518+00 | 1F4BAAF5B9 | 99E51BE286B9A3FE9275 | null | null | null |
5 | 2022-10-30 18:51:15.711518+00 | 0BB0DC78E8 | 1C3B0C56A3BE3D5A7987 | null | null | null |
6 | 2022-10-30 18:51:15.711518+00 | 1100FB3136 | B7823EDB76216127F89E | null | null | null |
7 | 2022-10-30 18:51:15.711518+00 | 4EC6EB44E8 | 491D17ADD0E20A1584B6 | null | null | null |
INSERT 0 7
id | created_at | login | password | init_index | parent_id | id | parent_id |
---|
SELECT 0
id | init_index | parent_id |
---|---|---|
1 | null | null |
2 | null | null |
3 | null | null |
4 | null | null |
5 | null | null |
6 | null | null |
7 | null | null |
8 | 1 | null |
9 | 2 | null |
10 | 3 | null |
11 | 4 | null |
12 | 5 | null |
13 | 6 | null |
SELECT 13