From 6d52a88523d23b5fd0503fd4145744c55dfddd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 26 Oct 2019 15:31:06 +0300 Subject: [PATCH] index --- MTM/task4-straipsnis/init.sql | 2 ++ 1 file changed, 2 insertions(+) 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;