<p></p>
<blockquote>
<p dir="auto">I believe using postgres as node cache was bad choice in the first place, and minor optimizations wont "save us" here. Postgres has way too much overhead for this purpose, in terms of time, storage space and IOPS. Simple high-performance key-value store library, such as LevelDB, would outperform it significantly.</p>
<p dir="auto">For example, Imposm is using LevelDB for node cache, and on my machine (cloud VM, so poor IOPS) building node cache takes about 1 hour, and 160 GB of disk space. osm2pgsql slim mode (with 50GB RAM cache) takes several hours, and I honestly don't know how much disk space, because I tried the latest planet yesterday, and it crashed on low disk space, with about 550 GB free at the start.</p>
</blockquote>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rouen-sk/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rouen-sk">@rouen-sk</a></p>
<p dir="auto">You are aware of the <a href="https://osm2pgsql.org/doc/manual.html#flat-node-store" rel="nofollow">--flat-nodes option</a> that osm2pgsql has supported for years to store nodes outside the database in an efficient and fast way?</p>
<p dir="auto">On my machine (non-cloud), it takes only 34m to import all <strong>+12B</strong> nodes of Facebook's Daylight distribution of OpenStreetMap using the <code class="notranslate">--flat-nodes</code> option, and the resulting file should be some 160GB as well. That still leaves the ways and relations stored in PostgreSQL for middle, but I am not sure if imposm doesn't store them as well in PostgreSQL?</p>
<p dir="auto">550GB free space for a Planet import is becoming very tight. Planet is just to big nowadays, and honestly, with good 4TB NVMe PCIe 3-5.x drives now as low as maybe $200-300, shortage of disk space or IOPS should be no excuse for a failed import.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/osm2pgsql-dev/osm2pgsql/issues/2110#issuecomment-1847755699">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353XJSTKO4MY5K7LDFYTYINU3PAVCNFSM6AAAAABAGEA4R2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXG42TKNRZHE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353US3G4SOIOGTY2QHYLYINU3PA5CNFSM6AAAAABAGEA4R2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTOEKB3G.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><osm2pgsql-dev/osm2pgsql/issues/2110/1847755699</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/osm2pgsql-dev/osm2pgsql/issues/2110#issuecomment-1847755699",
"url": "https://github.com/osm2pgsql-dev/osm2pgsql/issues/2110#issuecomment-1847755699",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>