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 | color | price | description |
---|---|---|---|---|
1 | ["Banana"] | [["Green"]] | [[[1]]] | [[["Good"]]] |
2 | ["Banana"] | [["Yellow"]] | [[[]]] | [[[]]] |
3 | ["Apple", "Carrot"] | [["Red"], ["Orange"]] | [[[10]], [[14]]] | [[["Round"]], [["Long"]]] |
4 | ["Grape", "Pineapple"] | [["Green"], ["Brown", "Pink"]] | [[[2]], [[13], [29]]] | [[["Small"]], [["Short"], ["Tall"]]] |
5 | ["Orange", "Potato"] | [["Orange"], ["Purple", "Brown"]] | [[[2]], [[9], []]] | [[["Bright"]], [["Gross"], []]] |
INSERT 0 5
CREATE FUNCTION
id | name | color | price | description |
---|---|---|---|---|
1 | Banana | Green | 1 | Good |
2 | Banana | Yellow | null | null |
3 | Carrot | Orange | 14 | Long |
3 | Apple | Red | 10 | Round |
4 | Grape | Green | 2 | Small |
4 | Pineapple | Pink | 29 | Tall |
4 | Pineapple | Brown | 13 | Short |
5 | Potato | Brown | null | null |
5 | Orange | Orange | 2 | Bright |
5 | Potato | Purple | 9 | Gross |
SELECT 10
id | name | color | price | description |
---|---|---|---|---|
1 | "Banana" | "Green" | 1 | "Good" |
2 | "Banana" | "Yellow" | null | null |
3 | "Apple" | "Red" | 10 | "Round" |
3 | "Carrot" | "Orange" | 14 | "Long" |
4 | "Grape" | "Green" | 2 | "Small" |
4 | "Pineapple" | "Brown" | 13 | "Short" |
4 | "Pineapple" | "Pink" | 29 | "Tall" |
5 | "Orange" | "Orange" | 2 | "Bright" |
5 | "Potato" | "Purple" | 9 | "Gross" |
5 | "Potato" | "Brown" | null | null |
SELECT 10