]> git.openstreetmap.org Git - nominatim.git/blob - lib-sql/tables/interpolation.sql
split up table creation SQL into separate files
[nominatim.git] / lib-sql / tables / interpolation.sql
1 -- SPDX-License-Identifier: GPL-2.0-only
2 --
3 -- This file is part of Nominatim. (https://nominatim.org)
4 --
5 -- Copyright (C) 2026 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
7
8 DROP TABLE IF EXISTS location_property_osmline;
9 CREATE TABLE location_property_osmline (
10     place_id BIGINT NOT NULL,
11     osm_id BIGINT NOT NULL,
12     parent_place_id BIGINT,
13     geometry_sector INTEGER NOT NULL,
14     indexed_date TIMESTAMP,
15     startnumber INTEGER,
16     endnumber INTEGER,
17     step SMALLINT,
18     partition SMALLINT NOT NULL,
19     indexed_status SMALLINT NOT NULL,
20     linegeo GEOMETRY NOT NULL,
21     address HSTORE,
22     token_info JSONB, -- custom column for tokenizer use only
23     postcode TEXT,
24     country_code VARCHAR(2)
25   ){{db.tablespace.search_data}};
26
27 CREATE UNIQUE INDEX idx_osmline_place_id ON location_property_osmline
28   USING BTREE (place_id) {{db.tablespace.search_index}};
29 CREATE INDEX idx_osmline_geometry_sector ON location_property_osmline
30   USING BTREE (geometry_sector) {{db.tablespace.address_index}};
31 CREATE INDEX idx_osmline_linegeo ON location_property_osmline
32   USING GIST (linegeo) {{db.tablespace.search_index}}
33   WHERE startnumber is not null;
34