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?.
id | name | json_obj | idx |
---|---|---|---|
1 | hello | {"id":1,"name":"hello"} | 0 |
4 | good | {"id":4,"name":"good"} | 1 |
7 | world | {"id":7,"name":"world"} | 2 |
9 | happy | {"id":9,"name":"happy"} | 3 |
10 | funny | {"id":10,"name":"funny"} | 4 |
12 | stack | {"id":12,"name":"stack"} | 5 |
15 | queue | {"id":15,"name":"queue"} | 6 |
18 | map | {"id":18,"name":"map"} | 7 |
19 | list | {"id":19,"name":"list"} | 8 |
23 | code | {"id":23,"name":"code"} | 9 |
json_agg |
---|
[{"id":10,"name":"funny"}, {"id":12,"name":"stack"}, {"id":15,"name":"queue"}, {"id":18,"name":"map"}] |
[{"id":19,"name":"list"}, {"id":23,"name":"code"}] |
[{"id":1,"name":"hello"}, {"id":4,"name":"good"}, {"id":7,"name":"world"}, {"id":9,"name":"happy"}] |