add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
id name path jsonobject jsonpath depth
1 Residential 1 {"name": "Residential", "children": []} {0} 0
2 Commercial 2 {"name": "Commercial", "children": []} {1} 0
3 Industrial 3 {"name": "Industrial", "children": []} {2} 0
4 Res type 1 1.4 {"name": "Res type 1", "children": []} {0,children,0} 1
5 Comm type 1 2.5 {"name": "Comm type 1", "children": []} {1,children,0} 1
6 Industrial 1 3.6 {"name": "Industrial 1", "children": []} {2,children,0} 1
7 Residential 2 1.4.7 {"name": "Residential 2", "children": []} {0,children,0,children,0} 2
8 Commercial 2 2.5.8 {"name": "Commercial 2", "children": []} {1,children,0,children,0} 2
9 Industrial 2 3.6.9 {"name": "Industrial 2", "children": []} {2,children,0,children,0} 2
SELECT 9
CREATE FUNCTION
nested_json
[{"name": "Residential", "children": [{"name": "Res type 1", "children": [{"name": "Residential 2", "children": []}]}]}, {"name": "Commercial", "children": [{"name": "Comm type 1", "children": [{"name": "Commercial 2", "children": []}]}]}, {"name": "Industrial", "children": [{"name": "Industrial 1", "children": [{"name": "Industrial 2", "children": []}]}]}]
SELECT 1