[postgis-users] ST_DWITHIN indices

Sairam Krishnamurthy kmsram420 at gmail.com
Thu May 5 14:50:40 PDT 2011


All,

Table structure: lat AS double, lon AS double, spatialPoint AS point.

I have a query that uses ST_DWITHIN. I was under the impression that this
function will use the gist index on spatialPoint.

Index query:
CREATE INDEX "table_spatial_index" ON "table" USING btree ("spatialPoint");

Select query:
SELECT lat, lon FROM "table" WHERE ST_DWITHIN("table"."spatialPoint",
ST_SetSRID(ST_MakePoint(0.064777,18.420500), 4326), 0.0011);

Query plan:

EXPLAIN SELECT lat, lon FROM "EVI250m" WHERE
ST_DWITHIN("EVI250m"."spatialPoint",
ST_SetSRID(ST_MakePoint(0.064777,18.420500), 4326), 0.0011);



 QUERY PLAN



-------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
------------
 Seq Scan on "EVI250m"  (cost=0.00..4757082.00 rows=1 width=16)
   Filter: (("spatialPoint" &&
'0103000020E61000000100000005000000000000A0224DB03F000000C05D6B3240000000A0224DB03F00000020EE6B3240000000C050DDB03F00000020EE6
) AND _st_dwithin("spatialPoint",
'0101000020E61000002A7288B83995B03FCFF753E3A56B3240'::geometry,
0.0011::double precision) AND ('0101000020E61000002A7288B83
recision)))
(2 rows)


Any thoughts ?



Thanks,
Sairam Krishnamurthy
+1 612 859 8161
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110505/ccb3d4de/attachment.html>


More information about the postgis-users mailing list