[postgis-users] postgis topology performance

Sandro Santilli strk at keybit.net
Wed Mar 19 11:08:23 PDT 2014

On Wed, Mar 19, 2014 at 06:43:21PM +0100, Rémi Cura wrote:
> Hey,
> We tried several way to load an already topologically correct shapefile
> into postgis topology .
> 10k lines loaded
> _Using totopogeom : 750 sec
> _Using addlinestring : 246 sec
> _Manually using addnode and st_addedgemodface : 86 sec.
> Still very slow  :-/
> Considering manually filling table /and/or using GEOS/or using grass loader.

Interesting numbers, thanks.
By "addlinestring" you mean TopoGeo_addLinestring ?
Is this with postgis trunk ?

Note that ST_AddEdgeModFace (called by TopoGeo_addLinestring)
still performs checks to verify the line you add does not
cross othe redges. There's currently no API exposed for simply
adding the linking attributes (face left/right and next edges).

I was thinking that one idea could be to manually insert all
the nodes and edges and then have a function to "polygonize"
the supposedly pre-noded resultance set. This would be pretty
much the same model used by GEOSPolygonize (requires pre-noded
input) and would probably be faster for batch constructions.

To complete the picture, how long does it take to simply insert
all your lines as edges ? So we get a feeling of IO and referential
integrity checks cost...


More information about the postgis-users mailing list