[postgis-tickets] [PostGIS] #5032: _postgis_index_extent gives bogus results on combined gist indexes (was: ST_EstimatedExtent gives bogus results on combined gist indexes)

PostGIS trac at osgeo.org
Tue Mar 29 11:01:44 PDT 2022


#5032: _postgis_index_extent gives bogus results on combined gist indexes
-----------------------------+---------------------------
  Reporter:  Björn Harrtell  |      Owner:  pramsey
      Type:  defect          |     Status:  new
  Priority:  medium          |  Milestone:  PostGIS 3.3.0
 Component:  postgis         |    Version:  master
Resolution:                  |   Keywords:
-----------------------------+---------------------------

Comment (by strk):

 It looks like we already have a _postgis_index_extent() since version
 2.5.0 ( #2256 )
 That method is just not documented, and its signature name seems to be for
 internal use only.

 Bjorn when trying your example on a PostgreSQL-13 I get a failure here:
 {{{
 create index test_k_geom_idx on test using gist (k, geom);
 ERROR:  data type integer has no default operator class for access method
 "gist"
 }}}

 It can be fixed by {{{ CREATE EXTENSION btree_gist; }}}

 So I confirm the bug is still present, and I'm updating the description to
 mention it's about {{{ _postgis_index_extent() }}} effectively. New repro:

 {{{
 CREATE EXTENSION IF NOT EXISTS btree_gist;
 DROP TABLE IF EXISTS test;

 WITH vals(k, geom) as (
   values
     (1, 'POINT(1 1)'::geometry),
     (2, 'POINT(1 2)'::geometry)
 )
 SELECT * INTO TABLE test FROM vals;

 SELECT _postgis_index_extent('test', 'geom');
 -- NULL

 CREATE INDEX test_geom_idx ON test using gist (geom);
 SELECT _postgis_index_extent('test', 'geom');
 -- BOX(1 1,1 2)

 DROP INDEX test_geom_idx;
 CREATE INDEX test_k_geom_idx on test using gist (k, geom);
 SELECT _postgis_index_extent('test', 'geom');
 -- BOX(1.401298464324817e-45 1,2.802596928649634e-45 1)

 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5032#comment:6>
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