[postgis-users] postgis support for 7.4 betas

David Blasby dblasby at refractions.net
Thu Sep 25 15:13:10 PDT 2003


Jeff Hoffmann wrote:

I did basically the same thing (and modified another function).

I've attached my version.

*NOTE* this very safe (unlikely to affect you) unless you:
    a. compile with the stats enabled
    b. add the statistical information to your database.


To actually turn on the stats package (and test it).  Do this:

1) verify that you turned on support in the makefile - "USE_STATS=1" 
about a dozen lines into the makefile.
2) Verify that there's an entry in geometry_columns for your geometry column

3) execute SELECT UPDATE_GEOMETRY_STATS();

3) Verify that there's a big HISTOGRAM2D(...) in the geometry_columns 
table for your data.
4)[OPTIONAL] Eye ball (dont count) the HISTOGRAM2D() and see if there's 
'about' enough entries in it (should be about the same as the number of 
rows in the table).  Ignore the first 6 numbers  - they're 
&xmin,&ymin,&xmax,&ymax,&boxesPerSide,&avgFeatureArea if you wanted to know.

5) stats should now be enabled.  You'll find that the geometry index is 
being used in a "wiser" way than before. Also, your EXPLAIN ANALYSE 
estimated-number-of-rows should be much more accurate.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: postgis_estimate.c
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20030925/13009cc4/attachment.c>


More information about the postgis-users mailing list