[postgis-users] Optimizer guess makes query 1000x slower?

strk strk at keybit.net
Tue Jun 15 03:32:50 PDT 2004


On Tue, Jun 15, 2004 at 03:24:22AM -0700, rm_postgis at cheapcomplexdevices.com wrote:
> 
> On Tue, 15 Jun 2004, strk wrote:
> >
> > What postgresql version are you using ?
> > Postgis built against PostgreSQL <= 74 require you to run
> > update_geometry_stats() to build statistics used by the
> > selectivity estimator.
> > 
> 
> I'm using 7.4.2 with postgis-0.8.1 .
> 
> 
> Perhaps my problem is that my data is tighly grouped 
> in a few cities ranging from Vancouver to Tallahassee.
> If the points were evenly distributed over that area, it
> probably would have only returned a single row in a
> sacramento-sized city.
> 
> However with only a dozen or so customers, almost all the
> data is in a small number of cities. 

Report explain analyze select ... results if you want more help.
Also try modifying the query. The selectivity estimator only works
in the presence of a constant geometry in one side of the && operator.

--strk;




More information about the postgis-users mailing list