[postgis-tickets] [PostGIS] #3739: ST_Within Not using index

PostGIS trac at osgeo.org
Wed Apr 19 06:42:58 PDT 2017


#3739: ST_Within Not using index
--------------------------+---------------------------
  Reporter:  postgispaul  |      Owner:  pramsey
      Type:  defect       |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS 2.3.3
 Component:  postgis      |    Version:  2.3.x
Resolution:               |   Keywords:
--------------------------+---------------------------

Comment (by pramsey):

 The default selectivity estimates from pgsql are bunk. We (I) may have
 made a critical mistake in swapping out the && operator, which while over-
 determined for these functions at least will be used correctly by the
 planner. The idea is that using the correct index op gives you a smaller
 result set to pass to the exact function, but that's no good if the index
 op is never called due to planning failures.

 The pgsql defaults are just selectivity constants, they don't look at the
 data at all. They aren't worse than nothing, they *are* nothing. So, if
 things work when you define ~ to && in your call, then that's probably
 what we should do ourselves as a quick fix.

 And an enhancement would be to do selectivity calculations correctly for @
 and ~. Not sure how enthused I am about that :)

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