[postgis-users] postgis slow performance

Narayanan, Divya dnarayan at randmcnally.com
Thu Aug 27 10:35:04 PDT 2009


Hi,

 

We were testing some queries to improve performance and found that the
queries using PostGIS were slower than those that did not.

 

I've included one of the queries tested

 

Query with PostGIS

 

SELECT ntb.id 

FROM navteq as ntb 

WHERE ( ntb.positioned_tsv @@ '(hotel|hodels|hoteles)'::tsquery) 

AND (latitude>34.00846 AND latitude<34.09855 AND longitude>-118.29926
AND longitude<-118.1907)

LIMIT 250

 

Query time: 1 second

 

Query using postgis:

 

SELECT ntb.id

FROM navteq_xtd_noothers as ntb 

WHERE ( ntb.positioned_tsv @@ '(hotel|hodels|hoteles)'::tsquery) 

AND geom && ST_SetSRID(ST_MakeBox2D(ST_Point(-118.29926,
34.00846),ST_Point(-118.1907, 34.09855)),4269)

LIMIT 250

 

Query time: 4 seconds

 

 

The latitude and longitude columns are indexed. The geom column uses a
GIST index. We're using Postgres v 8.1. Is there something we're doing
wrong? Please let me know if you need more information.

 

 

Thanks,

Divya
--------------------------------------------------------

This E-mail is confidential. It should not be read, copied, disclosed or used by any person other than the intended recipient. Unauthorized use, disclosure or copying by whatever medium is strictly prohibited and may be unlawful. If you have received this E-mail in error, please contact the sender immediately and delete the E-mail from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090827/e73bd5a2/attachment.html>


More information about the postgis-users mailing list