commit 6d52a88523d23b5fd0503fd4145744c55dfddd39 (tree)
parent 88f88fb5ed9468be45e520f9a64d31bf6f315d05
Author: Motiejus Jakštys <desired.mta@gmail.com>
Date: Sat, 26 Oct 2019 15:31:06 +0300
index
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git 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;