diff --git a/flex-config/sql/amenity.sql b/flex-config/sql/amenity.sql index 46e8e3d..4008ecc 100644 --- a/flex-config/sql/amenity.sql +++ b/flex-config/sql/amenity.sql @@ -17,11 +17,6 @@ ALTER TABLE osm.amenity_polygon ; -CREATE INDEX ix_osm_amenity_point_type ON osm.amenity_point (osm_type); -CREATE INDEX ix_osm_amenity_line_type ON osm.amenity_line (osm_type); -CREATE INDEX ix_osm_amenity_polygon_type ON osm.amenity_polygon (osm_type); - - COMMENT ON COLUMN osm.amenity_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.amenity_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.amenity_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/building.sql b/flex-config/sql/building.sql index 5c815a7..1a91f2c 100644 --- a/flex-config/sql/building.sql +++ b/flex-config/sql/building.sql @@ -39,8 +39,6 @@ ALTER TABLE osm.building_polygon ; -CREATE INDEX ix_osm_building_polygon_type ON osm.building_polygon (osm_type); - CREATE VIEW osm.vbuilding_all AS SELECT osm_id, 'N' AS geom_type, osm_type, osm_subtype, name, levels, diff --git a/flex-config/sql/infrastructure.sql b/flex-config/sql/infrastructure.sql index db97b4b..2f4598e 100644 --- a/flex-config/sql/infrastructure.sql +++ b/flex-config/sql/infrastructure.sql @@ -5,8 +5,6 @@ ALTER TABLE osm.infrastructure_point PRIMARY KEY (osm_id) ; -CREATE INDEX ix_osm_infrastructure_point_highway ON osm.infrastructure_point (osm_type); - COMMENT ON COLUMN osm.infrastructure_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.infrastructure_point.ele IS 'Elevation in meters'; diff --git a/flex-config/sql/landuse.sql b/flex-config/sql/landuse.sql index 80b3228..e810b3f 100644 --- a/flex-config/sql/landuse.sql +++ b/flex-config/sql/landuse.sql @@ -11,9 +11,6 @@ ALTER TABLE osm.landuse_polygon PRIMARY KEY (osm_id) ; -CREATE INDEX ix_osm_landuse_point_type ON osm.landuse_point (osm_type); -CREATE INDEX ix_osm_landuse_polygon_type ON osm.landuse_polygon (osm_type); - COMMENT ON COLUMN osm.landuse_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.landuse_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/leisure.sql b/flex-config/sql/leisure.sql index 65bcd14..f6678bc 100644 --- a/flex-config/sql/leisure.sql +++ b/flex-config/sql/leisure.sql @@ -11,9 +11,6 @@ ALTER TABLE osm.leisure_polygon PRIMARY KEY (osm_id) ; -CREATE INDEX ix_osm_leisure_point_type ON osm.leisure_point (osm_type); -CREATE INDEX ix_osm_leisure_polygon_type ON osm.leisure_polygon (osm_type); - COMMENT ON COLUMN osm.leisure_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.leisure_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/natural.sql b/flex-config/sql/natural.sql index ae1bc0b..89c62a4 100644 --- a/flex-config/sql/natural.sql +++ b/flex-config/sql/natural.sql @@ -20,11 +20,6 @@ ALTER TABLE osm.natural_polygon ; -CREATE INDEX ix_osm_natural_point_type ON osm.natural_point (osm_type); -CREATE INDEX ix_osm_natural_line_type ON osm.natural_line (osm_type); -CREATE INDEX ix_osm_natural_polygon_type ON osm.natural_polygon (osm_type); - - COMMENT ON COLUMN osm.natural_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.natural_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.natural_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/place.sql b/flex-config/sql/place.sql index df45521..5298e10 100644 --- a/flex-config/sql/place.sql +++ b/flex-config/sql/place.sql @@ -44,11 +44,6 @@ ALTER TABLE osm.place_polygon ; -CREATE INDEX ix_osm_place_point_type ON osm.place_point (osm_type); -CREATE INDEX ix_osm_place_line_type ON osm.place_line (osm_type); -CREATE INDEX ix_osm_place_polygon_type ON osm.place_polygon (osm_type); - - ------------------------------------------------ CREATE TEMP TABLE place_polygon_in_relations AS diff --git a/flex-config/sql/poi.sql b/flex-config/sql/poi.sql index 60f0a48..3d6948c 100644 --- a/flex-config/sql/poi.sql +++ b/flex-config/sql/poi.sql @@ -19,11 +19,6 @@ ALTER TABLE osm.poi_polygon ; -CREATE INDEX ix_osm_poi_point_type ON osm.poi_point (osm_type); -CREATE INDEX ix_osm_poi_line_type ON osm.poi_line (osm_type); -CREATE INDEX ix_osm_poi_polygon_type ON osm.poi_polygon (osm_type); - - COMMENT ON COLUMN osm.poi_point.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.'; COMMENT ON COLUMN osm.poi_line.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.'; COMMENT ON COLUMN osm.poi_polygon.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.'; diff --git a/flex-config/sql/public_transport.sql b/flex-config/sql/public_transport.sql index 1e1ba46..f404352 100644 --- a/flex-config/sql/public_transport.sql +++ b/flex-config/sql/public_transport.sql @@ -17,11 +17,6 @@ ALTER TABLE osm.public_transport_polygon ; -CREATE INDEX ix_osm_public_transport_point_type ON osm.public_transport_point (osm_type); -CREATE INDEX ix_osm_public_transport_line_type ON osm.public_transport_line (osm_type); -CREATE INDEX ix_osm_public_transport_polygon_type ON osm.public_transport_polygon (osm_type); - - COMMENT ON COLUMN osm.public_transport_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.public_transport_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.public_transport_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/road.sql b/flex-config/sql/road.sql index bf0e92b..4a4ad91 100644 --- a/flex-config/sql/road.sql +++ b/flex-config/sql/road.sql @@ -45,17 +45,6 @@ ALTER TABLE osm.road_line ; -CREATE INDEX ix_osm_road_point_highway ON osm.road_point (osm_type); -CREATE INDEX ix_osm_road_line_highway ON osm.road_line (osm_type); - - --- Standard use case is to query WHERE major. --- Opting for partial index to maximize benefits. -CREATE INDEX ix_osm_road_line_major - ON osm.road_line (major) - WHERE major; - - ------------------------------------------------ CREATE TEMP TABLE road_polygon_in_relations AS diff --git a/flex-config/sql/traffic.sql b/flex-config/sql/traffic.sql index 83338f5..715217e 100644 --- a/flex-config/sql/traffic.sql +++ b/flex-config/sql/traffic.sql @@ -17,8 +17,6 @@ ALTER TABLE osm.traffic_point ; -CREATE INDEX ix_osm_traffic_point_type ON osm.traffic_point (osm_type); - COMMENT ON COLUMN osm.traffic_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.traffic_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; COMMENT ON COLUMN osm.traffic_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.'; diff --git a/flex-config/sql/water.sql b/flex-config/sql/water.sql index b61c58a..a3a4586 100644 --- a/flex-config/sql/water.sql +++ b/flex-config/sql/water.sql @@ -52,13 +52,6 @@ ALTER TABLE osm.water_polygon PRIMARY KEY (osm_id) ; --- osm_type column only has natural/waterway values. --- Indexing osm_subtype b/c has more selective and seems more likely to be used. -CREATE INDEX ix_osm_water_point_type ON osm.water_point (osm_subtype); -CREATE INDEX ix_osm_water_line_type ON osm.water_line (osm_subtype); -CREATE INDEX ix_osm_water_polygon_type ON osm.water_polygon (osm_subtype); - - ------------------------------------------------ CREATE TEMP TABLE water_polygon_in_relations AS SELECT p_no_rel.osm_id diff --git a/flex-config/style/amenity.lua b/flex-config/style/amenity.lua index d4aa775..aff9ead 100644 --- a/flex-config/style/amenity.lua +++ b/flex-config/style/amenity.lua @@ -19,6 +19,11 @@ tables.amenity_point = osm2pgsql.define_table({ { column = 'wheelchair', type = 'text'}, { column = 'wheelchair_desc', type = 'text'}, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -39,6 +44,11 @@ tables.amenity_line = osm2pgsql.define_table({ { column = 'wheelchair', type = 'text'}, { column = 'wheelchair_desc', type = 'text'}, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -60,6 +70,11 @@ tables.amenity_polygon = osm2pgsql.define_table({ { column = 'wheelchair', type = 'text'}, { column = 'wheelchair_desc', type = 'text'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) diff --git a/flex-config/style/building.lua b/flex-config/style/building.lua index f005590..ff5fbbb 100644 --- a/flex-config/style/building.lua +++ b/flex-config/style/building.lua @@ -23,6 +23,11 @@ tables.building_point = osm2pgsql.define_table({ { column = 'wheelchair_desc', type = 'text'}, { column = 'operator', type = 'text'}, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -47,6 +52,11 @@ tables.building_polygon = osm2pgsql.define_table({ { column = 'wheelchair_desc', type = 'text'}, { column = 'operator', type = 'text'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) diff --git a/flex-config/style/indoor.lua b/flex-config/style/indoor.lua index f36f1d3..dee884f 100644 --- a/flex-config/style/indoor.lua +++ b/flex-config/style/indoor.lua @@ -17,6 +17,10 @@ tables.indoor_point = osm2pgsql.define_table({ { column = 'capacity', type = 'text'}, { column = 'highway', type = 'text'}, { column = 'geom', type = 'point' , projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -36,6 +40,10 @@ tables.indoor_line = osm2pgsql.define_table({ { column = 'capacity', type = 'text'}, { column = 'highway', type = 'text'}, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -55,6 +63,10 @@ tables.indoor_polygon = osm2pgsql.define_table({ { column = 'capacity', type = 'text'}, { column = 'highway', type = 'text'}, { column = 'geom', type = 'multipolygon' , projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) diff --git a/flex-config/style/infrastructure.lua b/flex-config/style/infrastructure.lua index 4428b56..bedb66b 100644 --- a/flex-config/style/infrastructure.lua +++ b/flex-config/style/infrastructure.lua @@ -28,6 +28,11 @@ tables.infrastructure_point = osm2pgsql.define_table({ { column = 'operator', type = 'text'}, { column = 'material', type = 'text'}, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -44,6 +49,11 @@ tables.infrastructure_line = osm2pgsql.define_table({ { column = 'operator', type = 'text'}, { column = 'material', type = 'text'}, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -61,6 +71,11 @@ tables.infrastructure_polygon = osm2pgsql.define_table({ { column = 'operator', type = 'text'}, { column = 'material', type = 'text'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) diff --git a/flex-config/style/landuse.lua b/flex-config/style/landuse.lua index 2392e75..1369f9a 100644 --- a/flex-config/style/landuse.lua +++ b/flex-config/style/landuse.lua @@ -11,6 +11,10 @@ tables.landuse_point = osm2pgsql.define_table({ { column = 'osm_type', type = 'text' , not_null = true}, { column = 'name', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -23,6 +27,10 @@ tables.landuse_polygon = osm2pgsql.define_table({ { column = 'osm_type', type = 'text', not_null = true}, { column = 'name', type = 'text' }, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) diff --git a/flex-config/style/leisure.lua b/flex-config/style/leisure.lua index b7a2f69..fb19526 100644 --- a/flex-config/style/leisure.lua +++ b/flex-config/style/leisure.lua @@ -11,6 +11,10 @@ tables.leisure_point = osm2pgsql.define_table({ { column = 'osm_type', type = 'text', not_null = true}, { column = 'name', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -23,6 +27,10 @@ tables.leisure_polygon = osm2pgsql.define_table({ { column = 'osm_type', type = 'text' , not_null = true}, { column = 'name', type = 'text' }, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) diff --git a/flex-config/style/natural.lua b/flex-config/style/natural.lua index b22a801..f203e16 100644 --- a/flex-config/style/natural.lua +++ b/flex-config/style/natural.lua @@ -12,6 +12,10 @@ tables.natural_point = osm2pgsql.define_table({ { column = 'name', type = 'text' }, { column = 'ele', type = 'int' }, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -25,6 +29,10 @@ tables.natural_line = osm2pgsql.define_table({ { column = 'name', type = 'text' }, { column = 'ele', type = 'int' }, { column = 'geom', type = 'linestring' , projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) @@ -38,6 +46,10 @@ tables.natural_polygon = osm2pgsql.define_table({ { column = 'name', type = 'text' }, { column = 'ele', type = 'int' }, { column = 'geom', type = 'multipolygon' , projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, } }) diff --git a/flex-config/style/place.lua b/flex-config/style/place.lua index 2812816..1945c58 100644 --- a/flex-config/style/place.lua +++ b/flex-config/style/place.lua @@ -13,6 +13,13 @@ tables.place_point = osm2pgsql.define_table({ { column = 'admin_level', type = 'int4' }, { column = 'name', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' }, + { column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' }, + { column = 'name', method = 'btree', where = 'name IS NOT NULL ' }, } }) @@ -26,6 +33,13 @@ tables.place_line = osm2pgsql.define_table({ { column = 'admin_level', type = 'int4' }, { column = 'name', type = 'text' }, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' }, + { column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' }, + { column = 'name', method = 'btree', where = 'name IS NOT NULL ' }, } }) @@ -41,6 +55,13 @@ tables.place_polygon = osm2pgsql.define_table({ { column = 'name', type = 'text' }, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' }, + { column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' }, + { column = 'name', method = 'btree', where = 'name IS NOT NULL ' }, } }) diff --git a/flex-config/style/poi.lua b/flex-config/style/poi.lua index bfd360d..05d6578 100644 --- a/flex-config/style/poi.lua +++ b/flex-config/style/poi.lua @@ -139,6 +139,11 @@ tables.poi_point = osm2pgsql.define_table({ { column = 'address', type = 'text', not_null = true}, { column = 'operator', type = 'text'}, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -159,6 +164,11 @@ tables.poi_line = osm2pgsql.define_table({ { column = 'address', type = 'text', not_null = true}, { column = 'operator', type = 'text'}, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -179,6 +189,11 @@ tables.poi_polygon = osm2pgsql.define_table({ { column = 'operator', type = 'text'}, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) diff --git a/flex-config/style/public_transport.lua b/flex-config/style/public_transport.lua index d2ac21b..529e25c 100644 --- a/flex-config/style/public_transport.lua +++ b/flex-config/style/public_transport.lua @@ -23,6 +23,11 @@ tables.public_transport_point = osm2pgsql.define_table({ { column = 'wheelchair', type = 'text'}, { column = 'wheelchair_desc', type = 'text'}, { column = 'geom', type = 'point', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -50,6 +55,11 @@ tables.public_transport_line = osm2pgsql.define_table({ { column = 'wheelchair_desc', type = 'text'}, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multilinestring', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -76,6 +86,11 @@ tables.public_transport_polygon = osm2pgsql.define_table({ { column = 'wheelchair_desc', type = 'text'}, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) diff --git a/flex-config/style/road.lua b/flex-config/style/road.lua index b28d8ad..3abb524 100644 --- a/flex-config/style/road.lua +++ b/flex-config/style/road.lua @@ -17,6 +17,11 @@ tables.road_point = osm2pgsql.define_table({ { column = 'bridge', type = 'text' }, { column = 'access', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'ref', method = 'btree' }, } }) @@ -42,6 +47,12 @@ tables.road_line = osm2pgsql.define_table({ { column = 'access', type = 'text' }, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multilinestring', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'major', method = 'btree', where = 'major' }, + { column = 'osm_type', method = 'btree' }, + { column = 'ref', method = 'btree' }, } }) @@ -65,6 +76,12 @@ tables.road_polygon = osm2pgsql.define_table({ { column = 'access', type = 'text' }, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true } + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'major', method = 'btree', where = 'major' }, + { column = 'osm_type', method = 'btree' }, + { column = 'ref', method = 'btree' }, } }) diff --git a/flex-config/style/road_major.lua b/flex-config/style/road_major.lua index 7c0d5e7..147fad8 100644 --- a/flex-config/style/road_major.lua +++ b/flex-config/style/road_major.lua @@ -17,6 +17,9 @@ tables.road_major = osm2pgsql.define_table({ { column = 'major', type = 'boolean', not_null = true}, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multilinestring', projection = srid, not_null = true }, + }, + indexes = { + { column = 'geom', method = 'gist' } } }) diff --git a/flex-config/style/shop.lua b/flex-config/style/shop.lua index 03cb597..e1853b7 100644 --- a/flex-config/style/shop.lua +++ b/flex-config/style/shop.lua @@ -23,6 +23,11 @@ tables.shop_point = osm2pgsql.define_table({ { column = 'brand', type = 'text'}, { column = 'website', type = 'text'}, { column = 'geom', type = 'point' , projection = srid, not_null = true }, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) @@ -48,6 +53,11 @@ tables.shop_polygon = osm2pgsql.define_table({ { column = 'brand', type = 'text'}, { column = 'website', type = 'text'}, { column = 'geom', type = 'multipolygon' , projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' }, } }) diff --git a/flex-config/style/traffic.lua b/flex-config/style/traffic.lua index 6df25d9..6a73a33 100644 --- a/flex-config/style/traffic.lua +++ b/flex-config/style/traffic.lua @@ -11,6 +11,11 @@ tables.traffic_point = osm2pgsql.define_table({ { column = 'osm_type', type = 'text', not_null = true }, { column = 'osm_subtype', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true }, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -23,6 +28,11 @@ tables.traffic_line = osm2pgsql.define_table({ { column = 'osm_type', type = 'text', not_null = true }, { column = 'osm_subtype', type = 'text' }, { column = 'geom', type = 'linestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -35,6 +45,11 @@ tables.traffic_polygon = osm2pgsql.define_table({ { column = 'osm_type', type = 'text', not_null = true }, { column = 'osm_subtype', type = 'text' }, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) diff --git a/flex-config/style/water.lua b/flex-config/style/water.lua index 09e82a7..7dd006b 100644 --- a/flex-config/style/water.lua +++ b/flex-config/style/water.lua @@ -15,6 +15,11 @@ tables.water_point = osm2pgsql.define_table({ { column = 'bridge', type = 'text' }, { column = 'boat', type = 'text' }, { column = 'geom', type = 'point', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -33,6 +38,11 @@ tables.water_line = osm2pgsql.define_table({ { column = 'boat', type = 'text' }, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multilinestring', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } }) @@ -51,6 +61,11 @@ tables.water_polygon = osm2pgsql.define_table({ { column = 'boat', type = 'text' }, { column = 'member_ids', type = 'jsonb'}, { column = 'geom', type = 'multipolygon', projection = srid, not_null = true}, + }, + indexes = { + { column = 'geom', method = 'gist' }, + { column = 'osm_type', method = 'btree' }, + { column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL ' }, } })