I can't get PostGIS 2.1 running on PostgreSQL 9.3.5 to use a spatial index even for the simplest queries. The whole dataset is 8 million points (population count grid from here http://sedac.ciesin.columbia.edu/data/set/gpw-v3-population-count), the table is created as CREATE TABLE points (population DOUBLE PRECISION NOT NULL, location GEOGRAPHY(4326, POINT) NOT NULL)
, index is CREATE INDEX points_gix ON points USING GIST(location)
. The queries are as simple as they get SELECT SUM(population) FROM points WHERE ST_Distance(location, ST_GeographyFromText('SRID=4326; POINT(0 0)')) < 1000
. PostgreSQL always uses Seq scan for it, I've tried a subset with 10000 points - still Seq scan. Any ideas?
dimanche 30 novembre 2014
PostGIS doesn't use index for spatial query
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire