[postgis-tickets] [PostGIS] #3753: Gist penalty misbehaves if points are inserted in gridded ordered fashion

PostGIS trac at osgeo.org
Mon May 15 01:08:59 PDT 2017


#3753: Gist penalty misbehaves if points are inserted in gridded ordered fashion
----------------------+---------------------------
  Reporter:  komzpa   |      Owner:  robe
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 2.4.0
 Component:  postgis  |    Version:  2.3.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by x4m):

 @Komzpa pinged me with a new test with integer grid for 2D
 {{{
 begin transaction;
 SELECT setseed(.43);

 create table dataTable as select ST_MakePoint(x,y) c from
 generate_series(1,1e3,1)x, generate_series(1,1e3,1) y;

 \timing on
 create index idx on dataTable using gist(c);

 select q,(select count(*) from dataTable dt where dt.c && q) from (select
 ST_Expand(ST_MakePoint(x,y), 100) q from (select random()*1000 x,
 random()*1000 y from generate_series(1,3e3,1) s0) s1) s2 ;

 select pg_size_pretty(pg_relation_size('idx'));

 drop table datatable;
 }}}

 Without patch I observe index with 43MB size and 109.2 seconds for select.
 With patch index size is 56MB and select time 68.2 seconds.
 Not a radical performance improvement, but still viable.

 I still suggest dropping lines
 {{{
                 if (size_orig > 0)
                 {
                         *result = pack_float(size_orig, 1); /* REALM 1 */
                 }
                 else
 }}}
 They were part of original patch, but in PostGIS I observe several
 percents of performance improvement without them. If necessary, I can make
 more precise statistical estimates.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3753#comment:10>
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-tickets mailing list