[postgis-tickets] [PostGIS] #3548: Slow queries with ST_DWithin and geography columns

PostGIS trac at osgeo.org
Mon May 9 10:21:42 PDT 2016


#3548: Slow queries with ST_DWithin and geography columns
--------------------------+----------------------------------
  Reporter:  rdallasgray  |      Owner:  pramsey
      Type:  defect       |     Status:  closed
  Priority:  medium       |  Milestone:  PostGIS 2.2.3
 Component:  postgis      |    Version:  2.1.x
Resolution:  invalid      |   Keywords:  ST_DWithin geography
--------------------------+----------------------------------
Changes (by pramsey):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Spherical calculations are just more expensive than planar ones, as you've
 demonstrated.

 Only thing I see about your query you might want to change is, rather than
 building up a 200-vertex line and calling dwithin on that, build up 199
 2-vertex segments, and do a join against that set. The index winnow much
 better, since it won't be using a global bounding box for the whole line,
 but instead 199 much smaller ones for the segments.

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