[Tile-serving] [openstreetmap/osm2pgsql] Disable sequential scan on database tables in copy threads (PR #1997)
Jochen Topf
notifications at github.com
Fri Jul 14 09:56:29 UTC 2023
This forces the DELETEs to use an index scan which is much faster.
The underlying problem here is probably that the DELETEs are called for all OSM objects in the input file, regardless of whether they are even in the table. For most tables most ids will not be in there. So PostgreSQL overestimates the number of "hits" it is going to get and thinks a full table scan is more efficient when in fact an index lookup is much better.
The COPYs used in the same database connection are not affected by this.
In many tests I have done I only see this problem in some cases, but when it hits it can slow down processing considerably. This could explain the occasional slow processing that some people have been reporting over the years and that we could never really nail down (#1674, #1971).
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/osm2pgsql/pull/1997
-- Commit Summary --
* Disable sequential scan on database tables in copy threads
-- File Changes --
M src/db-copy.cpp (8)
-- Patch Links --
https://github.com/openstreetmap/osm2pgsql/pull/1997.patch
https://github.com/openstreetmap/osm2pgsql/pull/1997.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1997
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/osm2pgsql/pull/1997 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230714/3db7f366/attachment.htm>
More information about the Tile-serving
mailing list