<p></p>
<p>I'v tested import on <a href="https://download.bbbike.org/osm/bbbike/Chicago/Chicago.osm.pbf" rel="nofollow">Chicago extract (51MB) from bbbike in pbf format</a>.</p>
<p>The result is above: 652 - 26 (k/s for nodes and ways).</p>
<p>Then I extract only ways from file (<code> osmconvert --drop-nodes --drop-relations --out-pbf -o=$RESULT_NAME-nodes.osm.pbf $OSM_SOURCE</code>) and run import again and I have the results: 0 - 9 .</p>
<p>Why for file with nodes ways imported almost x3 faster then for file without nodes?</p>
<p>To exclude the possibility of influence of the pbf-file format I extracted nodes from source file (<code>osmconvert --drop-ways --drop-relations --out-pbf -o=$RESULT_NAME-nodes.osm.pbf $OSM_SOURCE</code>) and then merge nodes with ways (<code>osmium cat -o $RESULT_FILE -f osm.pbf,add_metadata=false $NODES_FILE $WAYS_FILE </code>) and have the same results like for source file (652 - 26).</p>
<p>Also I've tested import source file without cache  (<code>--cache=0</code>) and I've got ways import speed 9k/s, like for only ways files.</p>
<p>Its seems like ways buffer depends on nodes buffer and it not used when imported pbf-file without nodes.</p>
<p>At the same time, when I import full planet file, I've got ways import speed just 0.89k/s. But when I extract only ways from planet file I'v got speed 9-12 k/s for ways.</p>
<p>Any ideas why is this happens?</p>
<p>Any suggestion how to debug where is the bottleneck and how to avoid it?</p>
<h2>My environment:</h2>
<pre><code># osm2pgsql --version
2021-03-19 20:11:36  osm2pgsql version 1.4.1 (1.4.1-16-gf7993c95)
Compiled using the following library versions:
Libosmium 2.16.0
Proj [API 4] Rel. 6.3.1, February 10th, 2020
Lua 5.2.4
</code></pre>
<pre><code># sudo --user=postgres osm2pgsql --create --slim --database=gis --merc --hstore-all --style=hstore-only.style --tag-transform-script=openstreetmap-carto.lua --prefix=planet_osm_hstore --number-processes=$NumberProcesses --cache=$CacheSizeMb $OSM_EXTRACT
</code></pre>
<pre><code>CacheSizeMb=16000
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1430">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353TQMGQ2VR7H3K4NH4LTEOFSXANCNFSM4ZPHWEGQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353TLTGPW5HXSTWBA5JDTEOFSXA5CNFSM4ZPHWEG2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MOX6F2A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/1430",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1430",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>