[osmosis-dev] osmosis, pgsimpl, bbox

Paul Norman penorman at mac.com
Mon Sep 9 07:59:29 UTC 2013


> From: Jörg Frings-Fürst [mailto:osm at jff-webhosting.net]
> Sent: Monday, September 09, 2013 12:47 AM
> To: osmosis-dev at openstreetmap.org
> Subject: [osmosis-dev] osmosis, pgsimpl, bbox
> 
> Hi,
> 
> on import the planet into pgsimple with action, bbox and linestring
> osmosis is running since 2013-08-31 13:09:41.79458+02 on this part:
> 
> UPDATE ways SET bbox = (SELECT ST_Envelope(ST_Collect(geom)) FROM nodes
> JOIN way_nodes ON way_nodes.node_id = nodes.id WHERE way_nodes.way_id =
> ways.id)
> 
> 
> I think that's a little too long
> 
> Any hints?

Yes. You're trying to build geometries with SQL which is slower than 
having osmosis build them. What was your exact osmosis command line?

I also suspect the table needs an ANALYZE and it's running a horrible query plan so it's taking even longer.

You appear to be using the load script so you need an ANALYZE before 
https://github.com/brettch/osmosis/blob/master/package/script/pgsimple_load_0.6.sql#L48
or it may try to use sequential scans for each way.

Even if you fix that, just have osmosis build the geometries and 
comment out what you need to in the SQL file.




More information about the osmosis-dev mailing list