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
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
crel_id | clat | clong |
---|---|---|
1708237 | 1 | 2 |
1703206 | 3 | 4 |
1703217 | 5 | 6 |
1703209 | 7 | 8 |
1703230 | 9 | 10 |
SELECT 5
id | name | lat | long | rel_id |
---|---|---|---|---|
1 | apple | null | null | 1708237 |
2 | orange | null | 1703206 | |
3 | cinnamon | 5 | null | 1703217 |
4 | qiwi | 8 | 1703209 | |
5 | cake | 9 | 10 | 1703230 |
SELECT 5
UPDATE 4
id | name | lat | long | rel_id |
---|---|---|---|---|
1 | apple | 1 | 2 | 1708237 |
2 | orange | 3 | 4 | 1703206 |
3 | cinnamon | 5 | 6 | 1703217 |
4 | qiwi | 7 | 8 | 1703209 |
5 | cake | 9 | 10 | 1703230 |
SELECT 5