[postgis-users] Not able to excute spatial query on postgresql database with postgis support

Michael Fuhr mike at fuhr.org
Mon Oct 30 07:21:08 PST 2006


On Mon, Oct 30, 2006 at 09:00:29AM -0600, vamsee movva wrote:
> "select count(*) from locations l1,county l2 where l1.the_geom &&
> l2.the_geom and intersects(l2.the_geom,l1.the_geom) and l2.countyid= some
> particular ID"
> 
> It gave some results, but i am not sure whether the query is correct or not,
> I have one more problem with this query, this query taking lot of time
> when some
> particular ID ends with 9999(ex:220750501002999,xxxxxxx9999), do u have any
> idea about this strange situation.

Are you sure 9999 is relevant or might it just be coincidence?  Does
9999 represent anything special in the data?  Do you have indexes
on the geometry and ID columns?  Have you vacuumed and analyzed the
tables?  What does EXPLAIN ANALYZE show for a slow query and for a
faster one?

-- 
Michael Fuhr



More information about the postgis-users mailing list