<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></p>
<p dir="auto">I think one problem is clear, indeed no ANALYZE before the DELETE statements start being emitted by osm2pgsql. Interesting question remains why this is far less of an issue in PG13 than 14. Obviously, and likely, there may have been changes in the PostgreSQL planner that cause the difference:</p>
<pre class="notranslate"><code class="notranslate">2022-05-19 21:13:24 Creating id index on table 'planet_osm_line'...
2022-05-19 21:13:24 SQL: CREATE INDEX ON "osm"."planet_osm_line" USING BTREE (osm_id) TABLESPACE "osm_k"
2022-05-19 21:13:24 Creating id index on table 'planet_osm_polygon'...
2022-05-19 21:13:24 SQL: CREATE INDEX ON "osm"."planet_osm_polygon" USING BTREE (osm_id) TABLESPACE "osm_i"
2022-05-19 21:13:24 Creating id index on table 'planet_osm_transport_line'...
2022-05-19 21:13:24 SQL: CREATE INDEX ON "osm"."planet_osm_transport_line" USING BTREE (osm_id) TABLESPACE "osm_j"
2022-05-19 21:13:24 Creating id index on table 'planet_osm_transport_polygon'...
2022-05-19 21:13:24 SQL: CREATE INDEX ON "osm"."planet_osm_transport_polygon" USING BTREE (osm_id) TABLESPACE "osm_j"
2022-05-19 21:13:24 Creating id index on table 'planet_osm_admin'...
2022-05-19 21:13:24 SQL: CREATE INDEX ON "osm"."planet_osm_admin" USING BTREE (osm_id) TABLESPACE "osm_k"
2022-05-19 21:13:24 Creating id indexes took 0s
2022-05-19 21:13:24 There are 1808 ways to reprocess...
2022-05-19 21:13:24 SQL: EXECUTE get_way(5363222)
etc...
2022-05-19 21:13:24 SQL: EXECUTE get_way(966204123)
2022-05-19 21:13:24 Dropping table 'planet_osm_nodes'
2022-05-19 21:13:24 SQL: DROP TABLE IF EXISTS "planet_osm_nodes"
2022-05-19 21:13:24 Table 'planet_osm_nodes' dropped in 0s
2022-05-19 21:13:24 Dropping table 'planet_osm_ways'
2022-05-19 21:13:24 SQL: DROP TABLE IF EXISTS "planet_osm_ways"
2022-05-19 21:13:25 Table 'planet_osm_ways' dropped in 1s
2022-05-19 21:13:25 Dropping table 'planet_osm_rels'
2022-05-19 21:13:25 SQL: DROP TABLE IF EXISTS "planet_osm_rels"
2022-05-19 21:13:25 Table 'planet_osm_rels' dropped in 0s
2022-05-19 21:13:25 Done postprocessing on table 'planet_osm_nodes' in 0s
2022-05-19 21:13:25 Done postprocessing on table 'planet_osm_ways' in 0s
2022-05-19 21:13:25 Done postprocessing on table 'planet_osm_rels' in 0s
2022-05-19 21:13:25 Clustering table 'planet_osm_point' by geometry...
2022-05-19 21:13:25 SQL: SET client_min_messages = WARNING
2022-05-19 21:13:25 SQL: DELETE FROM "osm"."planet_osm_polygon" WHERE osm_id IN (30969680,75393724,75393727,75393730,75393732,75393733,75393736,75393737,75393739,753
etc...
</code></pre>
<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-1132118515">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353TMKN2E2KKBET5OQ6TVK2JDJANCNFSM5V6VPZVA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AA6353WI5JWTLBOH4PDDLZLVK2JDJA5CNFSM5V6VPZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIN5MD4Y.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/1132118515</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-1132118515",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1674#issuecomment-1132118515",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>