<p></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/joto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/joto">@joto</a>. The exact command line is one below. The latest version of the osm2pgsql 'flex' LUA style used is the one below in the zip. Do notice this style has a top configuration section with a</p>
<p dir="auto"><code class="notranslate">local db_schema = 'public'</code></p>
<p dir="auto">configuration setting that needs to be changed to the appropriate schema if a using a dedicated schema. I still need to verify it, but the separate issue of missing indexes seemed to occur with the schema set to public.</p>
<p dir="auto"><a href="https://github.com/openstreetmap/osm2pgsql/files/8714129/openstreetmap-carto.zip">openstreetmap-carto.zip</a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168978751-ea5edca0-6e8d-43e2-942b-2797096e625d.png"><img src="https://user-images.githubusercontent.com/7635726/168978751-ea5edca0-6e8d-43e2-942b-2797096e625d.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto">I have now also had a look at the postgresql logs. One particular thing I noticed, is that I see the DELETE statements of the <strong>"There are X ways to reprocess"</strong> processing step intermingled with continuously repeating COPY statements for the Line table. Note that these continuously emitted COPY statements already started at the <strong>way</strong> loading stage, so before the <strong>"There are X ways to reprocess"</strong> processing step.</p>
<p dir="auto">Is this normal behavior? Strangely, I do not see these same SQL statements in pgAdmin, while I <strong>do</strong> see the DELETE statements in pgAdmin.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168984457-66b0e940-7bb0-4086-9d8b-170d12588109.png"><img src="https://user-images.githubusercontent.com/7635726/168984457-66b0e940-7bb0-4086-9d8b-170d12588109.png" alt="afbeelding" style="max-width: 100%;"></a></p>
<p dir="auto">I have also had a closer look at the actual resource usage during the slow running <strong>"There are X ways to reprocess"</strong> processing step. As you can see from these image, PostgreSQL is only using a single core at 75%-100%, and iowait is negligible, so there appears to be at least no IO bottleneck:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/7635726/168985197-dc050309-f786-4d33-90ad-899b1f1e89b2.png"><img src="https://user-images.githubusercontent.com/7635726/168985197-dc050309-f786-4d33-90ad-899b1f1e89b2.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/168985771-e3379e3f-50a2-4751-acf2-12172c3afb9c.png"><img src="https://user-images.githubusercontent.com/7635726/168985771-e3379e3f-50a2-4751-acf2-12172c3afb9c.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#issuecomment-1129687142">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353SBFMIOZD6HYRHGXATVKSOQHANCNFSM5V6VPZVA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353XSMYSBHNFZXH6IOMLVKSOQHA5CNFSM5V6VPZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOINK2QZQ.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/1129687142</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#issuecomment-1129687142",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1674#issuecomment-1129687142",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>