This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Using osm2pgsql slim mode with schemas that import very low amount of data

0
1

How does osm2pgsql slim mode work if I want to import the planet and my schema discards most objects? Does it still need every single node to be stored? (I think so because diffs carry no child object info, so if not all nodes of a way are modified it would need to pull the rest from somewhere - the slim nodes table)

Also, is the amount of processing time during the initial import still substantial due to how it processes data sequentially, even if the resulting table is going to be small in size?

In other words, does osm2pgsql scale down well for schemas that would only import a low number of objects - like keeping a table of POI? Or should I use osmfilter beforehand?

asked 17 Sep '16, 01:29

RicoElectrico's gravatar image

RicoElectrico
37161117
accept rate: 0%

edited 17 Sep '16, 01:40


One Answer:

1

You are correct, even if you discard most objects, osm2pgsql in slim mode needs to store all ways and relations with their tags and connections, as well as all node coordinates. (It does not have to store all node tags.)

If you don't need updates, you can use --slim --drop to reduce resource usage somewhat but it will still take a while. Filtering data with osmosis or osmfilter before you import with osm2pgsql will certainly speed things up in this scenario.

answered 17 Sep '16, 01:41

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%