[Tile-serving] [osm2pgsql-dev/osm2pgsql] osm2pgsql --append to existing imported slim database takes ages (Issue #2266)

Jochen Topf notifications at github.com
Wed Oct 23 07:24:45 UTC 2024


Thanks for your detailed report. We have seen similiar problems before, but with much larger change files. It seems this can happen also with smaller change files. The problem is indeed the `INSERT INTO osm2pgsql_changed_ways ...` query. For some reason PostgreSQL chooses a really bad plan for this rather simple query and the query then takes forever. Maybe this is related to the PostgreSQL version or something else we have not understood yet, because this works perfectly well in other cases. (Which also means that generally minutely updates do work fine, the change files are small and updates are fast.)

Apart from the PostgreSQL version, I can see two things that are "special" in your setup that could affect this: The setting for `default_statistics_target` is much higher than the default, generally this should *improve* the planner results, but who knows. The other thing is that you are only using DACH data and not the planet. In DACH the data is much "denser" than the average for the planet, so maybe this has something to do with it.

The idle `COPY` command should hopefully not affect this. But you could try osm2pgsql 2.0.0 where this issue is fixed and the COPY command is closed much earlier.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2266#issuecomment-2431132453
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/issues/2266/2431132453 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20241023/7bd4896c/attachment.htm>


More information about the Tile-serving mailing list