[postgis-users] slow extent queries?

Chander Ganesan chander at otg-nc.com
Sat Jun 16 18:09:57 PDT 2007


Chetan Tiwari wrote:
> Hi All
>
> I had a quick question about a relatively simple problem. I have 2 
> point-based datasets (table1 and table2). I'd like to find out which 
> dataset covers a larger geographic area. I guess there can be several 
> ways of trying to figure that out. What I'm using is a query like
>
> select extent(t1.the_geom) ~ extent(t2.the_geom) from myschema.table1 
> t1, myschema.table2 t2;
Might ST_convexhull() give a "better" result.? You could then use the 
ST_area() function on it...  I think ST_extent() will give you a box3d, 
which might be much larger than the geographical area covered.
>
> Table 1 contains about 5500 points and table 2 around 8000. The query 
> takes about a minute to execute (with and without indexes on the_geom) 
> and I was wondering if there was something that I was doing wrong or 
> if there was a more efficient way of accomplishing this task?
I don't think an index could be used here, since you're using a function 
that requires each individual value and therefore a table scan.
>
> Thanks much,
>
> Chetan
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   
Chander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070616/a824c6a5/attachment.html>


More information about the postgis-users mailing list