Skip to content

Commit

Permalink
SQL indexes fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kocio-pl committed May 17, 2018
1 parent 8474fc6 commit b9f31c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ CREATE INDEX planet_osm_polygon_water
WHERE waterway IN ('dock', 'riverbank', 'canal')
OR landuse IN ('reservoir', 'basin')
OR "natural" IN ('water', 'glacier');
CREATE INDEX planet_osm_polygon_military
ON planet_osm_polygon USING GIST (way)
WHERE landuse = 'military';
CREATE INDEX planet_osm_polygon_nobuilding
ON planet_osm_polygon USING GIST (way)
WHERE building IS NULL;
CREATE INDEX planet_osm_polygon_name
ON planet_osm_polygon USING GIST (way)
WHERE name IS NOT NULL;
CREATE INDEX planet_osm_polygon_way_area_z10
ON planet_osm_polygon USING GIST (way)
WHERE way_area > 23300;
CREATE INDEX planet_osm_polygon_military
ON planet_osm_polygon USING GIST (way)
WHERE landuse = 'military';
CREATE INDEX planet_osm_polygon_way_area_z6
ON planet_osm_polygon USING GIST (way)
WHERE way_area > 59750;
WHERE way_area > 5980000;
CREATE INDEX planet_osm_point_place
ON planet_osm_point USING GIST (way)
WHERE place IS NOT NULL AND name IS NOT NULL;
4 changes: 3 additions & 1 deletion indexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ polygon:
OR landuse IN ('reservoir', 'basin')
OR "natural" IN ('water', 'glacier')
way_area_z6:
where: way_area > 59750
where: way_area > 5980000
way_area_z10:
where: way_area > 23300
roads:
# The roads table only has a subset of data, so it's just got some low-zoom
# indexes and some fairly selective ones for high zoom
Expand Down

0 comments on commit b9f31c5

Please sign in to comment.