[PostGIS] #5990: Adding 2 lines to Postgis topology takes 2 hours in a production line we have

PostGIS trac at osgeo.org
Sun Sep 21 19:55:03 PDT 2025


#5990: Adding 2 lines to Postgis topology takes 2 hours in a production line we
have
--------------------------------+---------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  strk
      Type:  enhancement        |     Status:  reopened
  Priority:  medium             |  Milestone:  PostGIS 3.6.1
 Component:  topology           |    Version:  3.6.x
Resolution:                     |   Keywords:
--------------------------------+---------------------------
Comment (by Lars Aksel Opsahl):

 With no snapping (zero Tolerance in the Topology) we also get new nodes in
 topology result which is correct. In this case the second line is then
 added in around 4 seconds so this goes much faster.

 The reason way I do not run with zero tolerance is that then I have other
 cases that totally kills the performance because of all edges and faces
 generated and that I have to remove afterwords.

 So the main problem now is that I don't know what happens before the line
 string is added and the job is done and when I get many thousands of new
 edges back back after a very a long time I also have to clean up by
 removing all the edges not needed in may case.

 But if we had an extra parameter (max_edges) for TopoGeo_addLinestring
 indicating how many edges I accept for this line and then just throw a
 exception if that number is higher than max_edges , when max_edges is set.

 The caller catch this exception and then decide to change tolerance or run
 with higher value for max_edges for each case.

 In the application I can of course try to do some kind checks upfront, but
 it's better to have this checks in the Topology core code I think and then
 it's just up the caller to decide if he needs to use the parameter for
 max_edge or not.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5990#comment:9>
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