Wrap place UNIONs into one SELECT to sppeed up rendering

This commit is contained in:
jirik
2018-11-27 22:20:44 +01:00
committed by Jiri Kozel
parent 927d3945e2
commit 8d591a59aa
2 changed files with 5 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ CREATE OR REPLACE FUNCTION layer_place(bbox geometry, zoom_level int, pixel_widt
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
name_de text, tags hstore, class text, "rank" int, capital INT, iso_a2
TEXT) AS $$
SELECT * FROM (
-- etldoc: osm_continent_point -> layer_place:z0_3
SELECT
@@ -94,4 +95,5 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
NULL::text AS iso_a2
FROM layer_city(bbox, zoom_level, pixel_width)
ORDER BY "rank" ASC
) AS place_all
$$ LANGUAGE SQL IMMUTABLE;