[postgis-devel] [PostGIS] #253: Gist causes wrong result from ~=

PostGIS trac at osgeo.org
Fri Oct 2 07:03:58 PDT 2009


#253: Gist causes wrong result from ~=
----------------------+-----------------------------------------------------
  Reporter:  nicklas  |       Owner:  pramsey      
      Type:  defect   |      Status:  new          
  Priority:  medium   |   Milestone:  postgis 1.5.0
 Component:  postgis  |     Version:  1.4.X        
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------
Comment (by robe):

 I just thought of something. Note that I feel all these changes are so
 breaking in what people (granted possibly a minority of people are used
 to), that it should wait till 2.0.

 The = operator uses a btree index not a GIST index (and I think it has to
 because of some sort of requirement that is baked into the PostgreSQL
 behavior for dealing with DISTINCT, GROUPING, ORDER etc.,

 so the only equality operator we have that uses a gist index is ~=.  Now I
 suppose you could leave the recheck out and change the ST_OrderingEquals
 to be

 $1 ~= $2 AND _ST_OrderingEquals($1,$2)

 ST_Equals -- then ST_Equals could use

 $1 ~= $2 AND _ST_Equals($1,$2)

 (Right now note ST_Equals would have to use && which is much less
 efficient than a bounding box = because we have no bounding box = that
 uses GIST index) and we can't use ~= because well ST_Equals does not imply
 true geometry equality though would have a requirement that the bounding
 boxes are equal.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/253#comment:15>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list