[postgis-users] speed difference between using operators and st_* functions

James Chamberlain james.chamberlain at gmail.com
Wed Jun 2 19:14:25 PDT 2010


I have a large dataset with many polygons, points, and 
geometrycollections and I have been testing different ways to query with 
very different results. I am querying for geometries within a bounding 
box or a radius from a point. I seem to get the best performance if I 
create a polygon to represent the bounding box or circle and then use 
operators such as && or @. If I instead use functions like st_intersects 
or st_contains the same operation takes much longer. Is that the 
expected behavior? Another benefit of using the operators is that they 
work with geometrycollections where many of the functions do not. Is 
there any reason to prefer the functions over operators for basic 
intersection and contains queries?

Thanks,

James




More information about the postgis-users mailing list