Review index on osm_waterway_linestring on osm_important_waterway_linestring_gen_z* (#1130)

Review index waterway.

* Remove not used index
* Fit index `osm_waterway_linestring_waterway_partial_idx` to query
pull/1147/head^2
Frédéric Rodrigo 2021-07-09 09:35:46 +02:00 zatwierdzone przez GitHub
rodzic 4eb240466e
commit a851f2c9e9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 10 usunięć

Wyświetl plik

@ -7,12 +7,10 @@ DROP TRIGGER IF EXISTS trigger_refresh ON waterway_important.updates;
-- and also makes it possible to filter out too short rivers
CREATE INDEX IF NOT EXISTS osm_waterway_linestring_waterway_partial_idx
ON osm_waterway_linestring (waterway)
WHERE waterway = 'river';
CREATE INDEX IF NOT EXISTS osm_waterway_linestring_name_partial_idx
ON osm_waterway_linestring (name)
WHERE name <> '';
ON osm_waterway_linestring ((true))
WHERE name <> ''
AND waterway = 'river'
AND ST_IsValid(geometry);
-- etldoc: osm_waterway_linestring -> osm_important_waterway_linestring
CREATE TABLE IF NOT EXISTS osm_important_waterway_linestring AS
@ -33,7 +31,6 @@ FROM (
AND ST_IsValid(geometry)
GROUP BY name, name_en, name_de, slice_language_tags(tags)
) AS waterway_union;
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_names ON osm_important_waterway_linestring (name);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_geometry_idx ON osm_important_waterway_linestring USING gist (geometry);
-- etldoc: osm_important_waterway_linestring -> osm_important_waterway_linestring_gen_z11
@ -48,7 +45,6 @@ SELECT ST_Simplify(geometry, ZRes(12)) AS geometry,
FROM osm_important_waterway_linestring
WHERE ST_Length(geometry) > 1000
);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z11_name_idx ON osm_important_waterway_linestring_gen_z11 (name);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z11_geometry_idx ON osm_important_waterway_linestring_gen_z11 USING gist (geometry);
-- etldoc: osm_important_waterway_linestring_gen_z11 -> osm_important_waterway_linestring_gen_z10
@ -63,7 +59,6 @@ SELECT ST_Simplify(geometry, ZRes(11)) AS geometry,
FROM osm_important_waterway_linestring_gen_z11
WHERE ST_Length(geometry) > 4000
);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z10_name_idx ON osm_important_waterway_linestring_gen_z10 (name);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z10_geometry_idx ON osm_important_waterway_linestring_gen_z10 USING gist (geometry);
-- etldoc: osm_important_waterway_linestring_gen_z10 -> osm_important_waterway_linestring_gen_z9
@ -78,7 +73,6 @@ SELECT ST_Simplify(geometry, ZRes(10)) AS geometry,
FROM osm_important_waterway_linestring_gen_z10
WHERE ST_Length(geometry) > 8000
);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z9_name_idx ON osm_important_waterway_linestring_gen_z9 (name);
CREATE INDEX IF NOT EXISTS osm_important_waterway_linestring_gen_z9_geometry_idx ON osm_important_waterway_linestring_gen_z9 USING gist (geometry);
-- Handle updates