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?.
1 rows affected
1 rows affected
1 rows affected
1 rows affected
id | val |
---|---|
1 | {a,b,d} |
2 | {a,e} |
3 | {a,b,d,e} |
4 | {b,c,d} |
id | array_element |
---|---|
1 | a |
1 | b |
1 | d |
2 | a |
2 | e |
3 | a |
3 | b |
3 | d |
3 | e |
4 | b |
4 | c |
4 | d |
id | id | count |
---|---|---|
1 | 2 | 1 |
1 | 3 | 3 |
1 | 4 | 2 |
2 | 1 | 1 |
2 | 3 | 2 |
3 | 1 | 3 |
3 | 2 | 2 |
3 | 4 | 2 |
4 | 1 | 2 |
4 | 3 | 2 |