[OSM-talk] How big should a planet.osm->osm2pgsql database be?

Jon Burgess jburgess777 at googlemail.com
Tue Jul 21 10:35:24 BST 2009


2009/7/21 Ævar Arnfjörð Bjarmason <avarab at gmail.com>:
> On Mon, Jul 20, 2009 at 10:50 PM, Jon Burgess<jburgess777 at googlemail.com> wrote:
>> On Mon, 2009-07-20 at 16:00 +0000, Ævar Arnfjörð Bjarmason wrote:
>>> Should the PostGIS database imported from the Planet.osm using
>>> osm2pgsql be only 13 GB? Someone else who imported it on #osm-dev
>>> reported a size of 48 GB.
>>>
>>> Here's how I imported it:
>>>
>>>
>>> $ md5sum planet-090715.osm.bz2
>>> c89227585338c72dfcf4ff5d2aaacf53  planet-090715.osm.bz2
>>>
>>> Imported with:
>>>
>>> $ osm2pgsql -d gis -U avar -W -S ./wikimedia.style planet-090715.osm
>>> $ osm2pgsql -d gis-osm-like -U avar -W -S ./default.style planet-090715.osm
>>>
>>> gis=# select pg_size_pretty(pg_database_size('gis-osm-like'));
>>>  pg_size_pretty
>>> ----------------
>>>  13 GB
>>> (1 row)
>>>
>>> gis=# select pg_size_pretty(pg_database_size('gis'));
>>>  pg_size_pretty
>>> ----------------
>>>  15 GB
>>> (1 row)
>>>
>>
>> That looks about correct for an import which was not done using the
>> --slim mode. There are far fewer tables and indexes.
>>
>> The data at [1] gives a breakdown of all the table & index sizes for a
>> full slim-mode import. The ones related to the tables which are present
>> in the non-slim mode total to about 13GB
>> (planet_osm_{point,line,roads,polygon}). The tables used for the slim
>> mode and diff imports add another 50GB+ (planet_osm_{nodes,ways,rels}).
>
> Thanks. From reading the wiki documentation and --help output I
> understood that was only there as a hack so you could import the
> planet on 32-bit systems, and that its indexes were only used for
> that.
>
> I've updated the wiki to clarify this a bit:
> http://wiki.openstreetmap.org/index.php?title=Osm2pgsql&diff=306449&oldid=304395

>From that page "A lot of database indexes will also only be created in
slim mode which will make your database larger  (but queries &
rendering will be faster"

Actually no -- the extra indexes and data are only useful for the diff
imports. They make no difference at all to the normal rendering speed.
I'll update the wiki page when I get some more time.

-- 
    Jon




More information about the talk mailing list