<p></p>
<h2 dir="auto">What version of osm2pgsql are you using?</h2>
<p dir="auto">1.6.0 (1.3.0-580-g06d4013)</p>
<h2 dir="auto">What operating system and PostgreSQL/PostGIS version are you using?</h2>
<p dir="auto">Ubuntu 20.04.1 LTS, PostgreSQL 14.3, PostGIS 3.2</p>
<h2 dir="auto">Tell us something about your system</h2>
<p dir="auto">HP Z840 with dual Xeon E5-2680 v4, 256 GB RAM, 4x2TB NVMe</p>
<h2 dir="auto">What did you do exactly?</h2>
<p dir="auto">Import Planet using osm2pgsql in an empty database.</p>
<h2 dir="auto">What did you expect to happen?</h2>
<p dir="auto"><strong>osm_id</strong> column indexes being properly created during the import process, and before the DELETE taking place in flex processing during the <strong>"There are X ways to reprocess"</strong> processing stage.</p>
<h2 dir="auto">What did happen instead?</h2>
<p dir="auto">Despite the index statements being visible as "idle" sessions in pgAdmin, no indexes are actually being created in PostgreSQL 14 after a successful upgrade from PostgreSQL 13 to 14. This causes a significant delay in the processing of the subsequent DELETE statements issued by osm2pgsql as part of the <strong>"There are X ways to reprocess"</strong> processing stage. It takes hours to process all of the DELETE statements, with consistent high disk read activity, suggesting PostgreSQL is going over the entire table time and again in a full table scan.</p>
<p dir="auto">Although I can no longer properly verify, since I upgraded my cluster, I have never seen such issues with PostgreSQL 13, and no huge delay was experienced on previous releases of PostgreSQL (The reprocessing ways stage in PostgreSQL 13 only took between 15-30 minutes max).</p>
<h2 dir="auto">What did you do to try analyzing the problem?</h2>
<p dir="auto">Reviewed osm2pgsql output and monitored database activity in pgAdmin:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168461331-bc484e0d-6ce5-4721-b3f3-20e10e6511fe.png"><img src="https://user-images.githubusercontent.com/7635726/168461331-bc484e0d-6ce5-4721-b3f3-20e10e6511fe.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168461360-56c9faff-165c-4ce5-88ba-246e488ae249.png"><img src="https://user-images.githubusercontent.com/7635726/168461360-56c9faff-165c-4ce5-88ba-246e488ae249.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168461367-d59e3f22-e6ff-4902-b179-e995e84c428c.png"><img src="https://user-images.githubusercontent.com/7635726/168461367-d59e3f22-e6ff-4902-b179-e995e84c428c.png" alt="afbeelding" style="max-width: 100%;"></a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1674">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353QT5PL22OF54NIKPALVKCPCBANCNFSM5V6VPZVA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353XIHPSP5KEE7MRRKN3VKCPCBA5CNFSM5V6VPZVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4SNPA2AA.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><openstreetmap/osm2pgsql/issues/1674</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/openstreetmap/osm2pgsql/issues/1674",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1674",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>