[postgis-devel] [PostGIS] #1828: Estimate returned by geography_gist_selectivity results in slow query plan for ST_DWithin

PostGIS trac at osgeo.org
Fri Jun 15 10:57:32 PDT 2012


#1828: Estimate returned by geography_gist_selectivity results in slow query plan
for ST_DWithin
---------------------------+------------------------------------------------
 Reporter:  realityexists  |       Owner:  mcayland     
     Type:  defect         |      Status:  new          
 Priority:  medium         |   Milestone:  PostGIS 2.0.1
Component:  postgis        |     Version:  2.0.x        
 Keywords:                 |  
---------------------------+------------------------------------------------

Comment(by strk):

 rewind, I take it back. The estimator is called anyway.
 For geometry the query must be changed to :

 {{{
 SELECT count(id) FROM _test_pos
 WHERE geom && ST_Buffer('SRID=4326;POINT(7 7)', 1);
 }}}

 Here's some debugging from the selectivity estimator:

 {{{
 NOTICE:  [geometry_estimate.c:geometry_gist_sel_2d:653] geometry_gist_sel
 called
 NOTICE:  [geometry_estimate.c:estimate_selectivity:446]  histogram has 126
 cols, 127 rows
 NOTICE:  [geometry_estimate.c:estimate_selectivity:447]  histogram geosize
 is 19.999001x19.999001
 NOTICE:  [geometry_estimate.c:estimate_selectivity:591]  search_box
 overlaps 182.000000 cells
 NOTICE:  [geometry_estimate.c:estimate_selectivity:592]  avg feat overlaps
 1.000300 cells
 NOTICE:  [geometry_estimate.c:estimate_selectivity:604]
 SUM(ov_histo_cells)=0.096025
 NOTICE:  [geometry_estimate.c:estimate_selectivity:605]  gain=0.999700
 NOTICE:  [geometry_estimate.c:estimate_selectivity:606]
 selectivity=0.095996
 NOTICE:  [geometry_estimate.c:geometry_gist_sel_2d:754]  returning
 computed value: 0.095996
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1828#comment:17>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list