[postgis-tickets] [PostGIS] #5025: Inconsistent behavior with ST_Within across versions

PostGIS trac at osgeo.org
Tue Jul 26 13:25:13 PDT 2022


#5025: Inconsistent behavior with ST_Within across versions
----------------------+---------------------------
  Reporter:  byrman   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.0.7
 Component:  postgis  |    Version:  3.1.x
Resolution:           |   Keywords:
----------------------+---------------------------
Comment (by pramsey):

 Ran this through the debugger, and it's definitely the support function,
 and also definitely really hard to fix. Higher up the line, PostgreSQL is
 (somehow) identifying the index of interest and sending it into the
 support function, and then the support function chooses an appropriate
 operator to append to the query based on that. However, when the index is
 a gist_geometry_ops_nd the operator chosen is the 3d operator (@@) which
 has strict 3d semantics. Meanwhile the function ST_Within has 2d
 semantics. And thus we get the "add an index, get fewer things" behaviour.

 The support function is trying to be really general, so it doesn't care
 what kind of index it gets and generally that works, in that it can add
 index clauses for SPGIST, BRIN and GIST indexes without caring much what
 kind of opfamily is coming in. Recognizing that ST_Within requires a 2d
 operator is a little hard...
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5025#comment:8>
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