I have a PostGIS-enabled database with a table called locations
that stores latitude-longitude points (SRID 4326) in a column called coordinates
. However, all of my lookups on that table convert the points to a metric projection (SRID 26986) mainly to do distance comparisons.
Obviously I'd like to create a spatial index on the coordinates
column. My question is, which is the best (most computationally efficient) SRID to use in the coordinates
spatial index in this case?
I can either index using SRID 4326...
CREATE INDEX locations_coordinates_gist
ON locations
USING GIST (coordinates);
Or using SRID 26986...
CREATE INDEX locations_coordinates_gist
ON locations
USING GIST (ST_Transform(coordinates, 26986));