From: Sarah Hoffmann Date: Mon, 22 Mar 2021 21:24:56 +0000 (+0100) Subject: create postcode id index earlier X-Git-Tag: v3.7.0~11^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/5dabc0aca8c557f3d47c0c7963863ffcf339247e create postcode id index earlier Now that the indexer takes care of indexing the postcode tables, the id index is needed to find the rows to index. --- diff --git a/lib-sql/indices.sql b/lib-sql/indices.sql index cb77e02b..f8c9d2ce 100644 --- a/lib-sql/indices.sql +++ b/lib-sql/indices.sql @@ -35,9 +35,6 @@ CREATE INDEX {{sql.if_index_not_exists}} idx_osmline_parent_place_id CREATE INDEX {{sql.if_index_not_exists}} idx_osmline_parent_osm_id ON location_property_osmline USING BTREE (osm_id) {{db.tablespace.search_index}}; -CREATE UNIQUE INDEX {{sql.if_index_not_exists}} idx_postcode_id - ON location_postcode USING BTREE (place_id) {{db.tablespace.search_index}}; - CREATE INDEX {{sql.if_index_not_exists}} idx_postcode_postcode ON location_postcode USING BTREE (postcode) {{db.tablespace.search_index}}; diff --git a/lib-sql/tables.sql b/lib-sql/tables.sql index 0895c6dd..329eb7a1 100644 --- a/lib-sql/tables.sql +++ b/lib-sql/tables.sql @@ -209,6 +209,7 @@ CREATE TABLE location_postcode ( postcode TEXT, geometry GEOMETRY(Geometry, 4326) ); +CREATE UNIQUE INDEX idx_postcode_id ON location_postcode USING BTREE (place_id) {{db.tablespace.search_index}}; CREATE INDEX idx_postcode_geometry ON location_postcode USING GIST (geometry) {{db.tablespace.address_index}}; GRANT SELECT ON location_postcode TO "{{config.DATABASE_WEBUSER}}" ;