diff --git a/MTM/task4-straipsnis/init.sql b/MTM/task4-straipsnis/init.sql index f5734fd..9c06cd5 100644 --- a/MTM/task4-straipsnis/init.sql +++ b/MTM/task4-straipsnis/init.sql @@ -19,6 +19,8 @@ CREATE TABLE airports ( CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text OR geom IS NULL), CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 4326) ); +-- create index for faster spatial lookups +CREATE INDEX idx_geom ON airports USING GIN (geom); -- import data from airports.dat \copy airports(gid, name, city, country, iata, icao, latitude, longitude, altitude, timezone, dst, tz, type, source) FROM 'airports.dat' DELIMITERS ',' CSV;