[postgis-users] Finding Extent

Swaminathan, Gayathri gayathri at ou.edu
Sun May 9 13:29:29 PDT 2004


Hi:

I am having a problem with figuring the best possible way to find extent
of my results for my mapping application..

My present query is:

"select xmin(extent(the_geom)),
ymin(extent(the_geom)),xmax(extent(the_geom)),ymax(extent(the_geom))
from nc where parcels_id in (<list of parcels>);"

But this ends up being a index scan on the parcels_id...and costs of
this query are directly tied to the number of parcels in my results.

I have indexes on the_geom, oid and parcels_id

I have done a vacuum analyze on this database.

But nothing seems to help the runtime of this query.

Version of Postgresql is 7.2.1
Version of Postgis is 0.7.5

What am I doing wrong? Is there a better way to find extents for
returned results.

Thanks
Gayathri







More information about the postgis-users mailing list