colouring-montreal/migrations/002.index-geometries.up.sql
2018-09-25 21:46:22 +01:00

11 lines
434 B
SQL

-- Create indexes after bulk loading geometries and building records
-- Spatial index over geometries
CREATE INDEX geometries_idx ON geometries USING GIST ( geometry_geom );
-- Source ID index over geometries
CREATE INDEX geometries_source_idx ON geometries ( source_id );
-- Index over building geometry_id (expect to look up building by geometry_id for map tiles)
CREATE INDEX building_geometry_idx ON buildings ( geometry_id );