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?.
4 rows affected
4 rows affected
from_station | to_station | count |
---|---|---|
Station A | Station B | 2 |
Station A | Station C | 1 |
Station B | Station D | 1 |
json_agg |
---|
[{"from_station":"Station A","to_station":"Station B","count":2}, {"from_station":"Station A","to_station":"Station C","count":1}, {"from_station":"Station B","to_station":"Station D","count":1}] |
from_station | to_station | count |
---|---|---|
Station A | Station A | 0 |
Station A | Station B | 2 |
Station A | Station C | 1 |
Station A | Station D | 0 |
Station B | Station A | 0 |
Station B | Station B | 0 |
Station B | Station C | 0 |
Station B | Station D | 1 |
Station C | Station A | 0 |
Station C | Station B | 0 |
Station C | Station C | 0 |
Station C | Station D | 0 |
Station D | Station A | 0 |
Station D | Station B | 0 |
Station D | Station C | 0 |
Station D | Station D | 0 |
json_agg |
---|
[{"from_station":"Station A","to_station":"Station A","count":0}, {"from_station":"Station A","to_station":"Station B","count":2}, {"from_station":"Station A","to_station":"Station C","count":1}, {"from_station":"Station A","to_station":"Station D","count":0}, {"from_station":"Station B","to_station":"Station A","count":0}, {"from_station":"Station B","to_station":"Station B","count":0}, {"from_station":"Station B","to_station":"Station C","count":0}, {"from_station":"Station B","to_station":"Station D","count":1}, {"from_station":"Station C","to_station":"Station A","count":0}, {"from_station":"Station C","to_station":"Station B","count":0}, {"from_station":"Station C","to_station":"Station C","count":0}, {"from_station":"Station C","to_station":"Station D","count":0}, {"from_station":"Station D","to_station":"Station A","count":0}, {"from_station":"Station D","to_station":"Station B","count":0}, {"from_station":"Station D","to_station":"Station C","count":0}, {"from_station":"Station D","to_station":"Station D","count":0}] |