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?.
SELECT 4
id | post_id | name | body | reply_to_id | relative_depth | path |
---|---|---|---|---|---|---|
1 | 1 | a | a | null | 0 | {1} |
2 | 1 | b | b | 1 | 1 | {1,2} |
4 | 1 | d | d | 2 | 2 | {1,2,4} |
3 | 1 | c | c | 1 | 1 | {1,3} |
SELECT 4