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 4
CREATE FUNCTION
tbl_id | data |
---|---|
1 | {"name": "foo", "tags": ["foo", "bar"]} |
2 | {"name": "empty", "tags": [null]} |
3 | {"name": "empty", "tags": []} |
4 | {"name": "none"} |
SELECT 4
tbl_id | jsonb_arr | txt_arr |
---|---|---|
1 | ["foo", "bar"] | {foo,bar} |
2 | [null] | {NULL} |
3 | [] | null |
4 | null | null |
SELECT 4
tbl_id | jsonb_arr | txt_arr |
---|---|---|
1 | ["foo", "bar"] | {foo,bar} |
2 | [null] | {NULL} |
3 | [] | null |
4 | null | null |
SELECT 4
tbl_id | jsonb_arr | txt_arr |
---|---|---|
1 | ["foo", "bar"] | {foo,bar} |
2 | [null] | {NULL} |
3 | [] | {} |
4 | null | {} |
SELECT 4
tbl_id | jsonb_arr | txt_arr |
---|---|---|
1 | ["foo", "bar"] | {foo,bar} |
2 | [null] | {NULL} |
3 | [] | {} |
4 | null | {} |
SELECT 4
tbl_id | jsonb_arr | txt_arr |
---|---|---|
1 | ["foo", "bar"] | {foo,bar} |
2 | [null] | {NULL} |
3 | [] | {} |
4 | null | null |
SELECT 4
tbl_id | list |
---|---|
1 | "foo", "bar" |
2 | null |
SELECT 2
tbl_id | txt_arr |
---|---|
1 | {""foo"",""bar""} |
2 | {"null"} |
3 | {} |
4 | {} |
SELECT 4
tbl_id | list |
---|---|
1 | foo, bar |
2 | null |
SELECT 2
list |
---|
foo, bar |
SELECT 1
tbl_id | list |
---|---|
1 | foo, bar |
2 | null |
3 | null |
4 | null |
SELECT 4
tbl_id | txt_arr |
---|---|
1 | {foo,bar} |
2 | {"null"} |
3 | {} |
4 | {} |
SELECT 4