[PostGIS] #3587: lwgeom_mindistance2d slows down topology loading

PostGIS trac at osgeo.org
Tue Mar 5 02:58:33 PST 2024


#3587: lwgeom_mindistance2d slows down topology loading
-----------------------+-----------------------------
  Reporter:  strk      |      Owner:  strk
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS Fund Me
 Component:  topology  |    Version:  2.2.x
Resolution:            |   Keywords:  performance
-----------------------+-----------------------------
Comment (by strk):

 I've attached test10input_singlepoly.sql.gz​ containing the linestrings
 forming a big polygon. Adding each line with `TopoGeo_addLinestring`,
 ordered by "path" (exterior ring first, interior ring later) have the
 following times on my laptop:


 {{{
 ==> load2-bigpoly.log.dist2d_fast_no_check_overlap <==
 Time: 1224127.033 ms (20:24.127)

 ==> load2-bigpoly.log.main <==
 Time: 1045277.101 ms (17:25.277)

 ==> load2-bigpoly.log.topo-addline-geosdistanceindexed <==
 Time: 262539.817 ms (04:22.540)

 ==> load2-bigpoly.log.topo-addline-intersects-buffer <==
 Time: 275923.548 ms (04:35.924)

 ==> load2-bigpoly.log.topo-adline-dwithin <==
 Time: 260558.026 ms (04:20.558)
 }}}

 To recap: 17m with master branch, 20m when forcing tree based mindist2d
 computation, ~4m when using either of the GEOS versions:
 intersects(buffer()), distanceIndexed, distanceWithin
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3587#comment:47>
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