[OSM-dev] Importing planet file with osmosis into PostgreSQL

Lars Francke lars.francke at gmail.com
Sun Dec 13 12:49:59 GMT 2009

> Currently I need about four days for importing the whole planet file. Is
> that a normal computing time? The bottleneck seems to be the database
> (PostgreSQL). Are there any hints for the database configuration? For
> conversion I use  a quadcore machine with 8GB RAM. Data files are
> located on an own hard drive.

I don't know if you have seen them already but there are some
performance tips in the PostgreSQL docs [1] for populating databases.
Increasing checkpoint_segments (I set mine to 256) and dropping all
foreign keys and indexes prior to the import helps but if I remember
correctly Osmosis does the latter automatically on an import.
Do you need the API DB [2] schema? Perhaps the simple schema [3][4] is
enough. I believe it is faster to import, I'm not 100% sure though.


[1]: http://www.postgresql.org/docs/8.3/static/populate.html
[2]: http://svn.openstreetmap.org/applications/utils/osmosis/trunk/script/contrib/apidb_0.6.sql
[3]: http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage#--write-pgsql_.28--wp.29
[4]: http://svn.openstreetmap.org/applications/utils/osmosis/trunk/script/pgsql_simple_schema_0.6.sql

More information about the dev mailing list