[postgis-users] more query optimization

David Blasby dblasby at refractions.net
Tue Jun 1 09:05:09 PDT 2004


Robert W. Burgholzer wrote:
> OK,
> the USE_STATS option was indeed set to 1 in my postgis makefile, I have 
> run the following query:
> 
> select update_geometry_stats();
> 
> And voila! the query comes back in under a minute,  perfectly 
> acceptable. Now, do you suggest I include this update_geometry_stats() 
> call in my daily vacuum job?


You only need to call update_geometry_stats() if your data significantly 
changes.  Basically, it build up a 2d histogram of your data, and uses 
this to estimate the number of results in a given query.  You only have 
to update it if the histogram is no longer an accurate reflection of 
your data.


dave



More information about the postgis-users mailing list