[postgis-tickets] [PostGIS] #3675: Relationship functions not using an index in some cases

PostGIS trac at osgeo.org
Wed Nov 8 12:45:04 PST 2017


#3675: Relationship functions not using an index in some cases
----------------------+---------------------------
  Reporter:  robe     |      Owner:  robe
      Type:  defect   |     Status:  closed
  Priority:  blocker  |  Milestone:  PostGIS 2.3.2
 Component:  postgis  |    Version:  2.3.x
Resolution:  fixed    |   Keywords:
----------------------+---------------------------

Comment (by pramsey):

 Just for fun, here's the test function but with the SQL inlining removed
 and replaced with the literal contents of ST_DWithin(). Annoyingly, it
 plans out fine, regardless of the cost of ST_SetSRID.
 {{{
 explain SELECT gid
 FROM  e, (SELECT longitude, latitude FROM e WHERE longitude = -1 and
 latitude = -1) As c
 WHERE  e.geom OPERATOR(&&) ST_Expand(ST_SetSRID(ST_Point( c.longitude,
 c.latitude), 4326),1)
 AND ST_SetSRID(ST_Point( c.longitude, c.latitude),4326) OPERATOR(&&)
 ST_Expand(e.geom,1)
 AND _ST_DWithin(ST_SetSRID(ST_Point( c.longitude, c.latitude), 4326),
 e.geom, 1);
 }}}

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