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

PostGIS trac at osgeo.org
Thu Jun 21 13:09:30 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.2
Component:  postgis        |     Version:  2.0.x        
 Keywords:                 |  
---------------------------+------------------------------------------------

Comment(by mcayland):

 One of the delays on this is that my dev environment is set up for 9.0 and
 so WITH... INSERT doesn't work. I've used the following as a substitute:

 CREATE OR REPLACE FUNCTION create1828() RETURNS text AS $$

 DECLARE
         cnt int;
         x float;
 BEGIN
         FOR x IN SELECT generate_series(1, 20000)::float / 1000 LOOP
                 -- RAISE NOTICE 'x is %', x;
                 INSERT INTO _test_pos(pos) SELECT ST_MakePoint(x,
 x)::geography;
         END LOOP;

         RETURN 'done';
 END;

 $$ LANGUAGE 'plpgsql';

 Now I have the actual sample data, I'll have a poke around and see if I
 can figure out what is happening.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1828#comment:23>
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