[postgis-users] Strange result about spatial indexes?

Paul Ramsey pramsey at opengeo.org
Fri Aug 14 10:34:49 PDT 2009


No surprise, any function that returns cheaply and immutably will
provide the same effect. The effect is so huge, that you can even get
faster results using expensive functions.

suelos=# select count(*) from suelos1 p1, suelos1 p2 where
(st_envelope(p1.geom) && p2.geom);
 count
-------
 13808
(1 row)
Time: 92.989 ms

suelos=# select count(*) from suelos1 p1, suelos1 p2 where
(st_setsrid(p1.geom,23030) && p2.geom);
 count
-------
 13808
(1 row)
Time: 92.626 ms

suelos=# select count(*) from suelos1 p1, suelos1 p2 where
(st_convexhull(p1.geom) && p2.geom); count
-------
 13808
(1 row)
Time: 237.928 ms

suelos=# select count(*) from suelos1 p1, suelos1 p2 where (p1.geom && p2.geom);
 count
-------
 13808
(1 row)
Time: 478.765 ms



More information about the postgis-users mailing list