Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- t1.id,
- t1.tags,
- t1.linestring
- FROM
- (SELECT
- relations.id,
- relations.tags,
- ways.linestring
- FROM
- public.relations,
- public.relation_members,
- public.ways
- WHERE
- relation_members.relation_id = relations.id AND
- ways.id = relation_members.member_id AND
- relation_members.member_type = 'W' AND
- relations.tags->'boundary' = 'administrative' AND
- relations.tags->'admin_level' = '6') as t1
- WHERE
- (t1.linestring && (SELECT geom FROM search ) AND ST_Intersects(t1.linestring, (SELECT geom FROM search )))
- ;
- -----------------------------------------------------------------
- "QUERY PLAN"
- "Nested Loop (cost=2.48..19.61 rows=1 width=947)"
- " InitPlan 1 (returns $0)"
- " -> Seq Scan on search (cost=0.00..1.24 rows=24 width=32)"
- " InitPlan 2 (returns $1)"
- " -> Seq Scan on search (cost=0.00..1.24 rows=24 width=32)"
- " -> Nested Loop (cost=0.00..16.81 rows=1 width=915)"
- " -> Index Scan using idx_ways_linestring on ways (cost=0.00..8.53 rows=1 width=915)"
- " Index Cond: (linestring && $0)"
- " Filter: st_intersects(linestring, $1)"
- " -> Index Scan using idx_relation_members_member_id_and_type on relation_members (cost=0.00..8.28 rows=1 width=16)"
- " Index Cond: ((relation_members.member_id = ways.id) AND (relation_members.member_type = 'W'::bpchar))"
- " -> Index Scan using pk_relations on relations (cost=0.00..0.30 rows=1 width=40)"
- " Index Cond: (relations.id = relation_members.relation_id)"
- " Filter: (((relations.tags -> 'boundary'::text) = 'administrative'::text) AND ((relations.tags -> 'admin_level'::text) = '6'::text))"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement