[postgis-users] Help with Bad Query Plan

Obe, Regina robe.dnd at cityofboston.gov
Fri Jan 9 05:29:06 PST 2009

>  If this is the case, it seems Oliver is almost certainly being bitten
> the && operator RECHECK :(

Will looking at it

 "  Join Filter: ((selected_geography.the_geom && geography.the_geom)
> AND _st_intersects(selected_geography.the_geom, geography.the_geom))" 

It doesn't even appear to be using a spatial index.  Oliver you sure you
have a spatial index in place and you 
did the vacuum analyze bit?

I was thinking if he had a spatial index in place then maybe he just has
too many indexes in use or just large and few geometries so the && index
is just lucking out.  I suppose he can play around with the costing
metrics in postgresql.conf.

So that was why I thought doing the (....gid=3) as a subselect would
help things because it would force that to be treated separately
from the rest of the plan and possibly materialize it too. Also the fact
that he has no index on report date can't be helping things.

The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.

More information about the postgis-users mailing list