Re: 64-bit XIDs in deleted nbtree pages
Peter Geoghegan <pg@bowt.ie>
On Fri, Feb 12, 2021 at 10:27 PM Victor Yegorov <vyegorov@gmail.com> wrote: > I'd like to outline one relevant case. > > Quite often bulk deletes are done on a time series data (oldest) and effectively > removes a continuous chunk of data at the (physical) beginning of the table, > this is especially true for the append-only tables. > After the delete, planning queries takes a long time, due to MergeJoin estimates > are using IndexScans ( see https://postgr.es/m/17467.1426090533@sss.pgh.pa.us ) > Right now we have to disable MergeJoins via the ALTER SYSTEM to mitigate this. > > So I would, actually, like it very much for VACUUM to kick in sooner in such cases. Masahiko was specifically concerned about workloads with bursty/uneven/mixed VACUUM triggering conditions -- he mentioned autovacuum_vacuum_insert_scale_factor/threshold as being applied to trigger a second VACUUM (which follows from an initial VACUUM that performs deletions following a bulk DELETE). A VACUUM that needs to delete index tuples will do its btvacuumscan() through the btbulkdelete() path, not through the btvacuumcleanup() "cleanup only" path. The btbulkdelete() path won't ever call _bt_vacuum_needs_cleanup() in the first place, and so there can be no risk that the relevant changes (changes that the patch makes to that function) will have some new bad effect. The problem that you have described seems very real, but it doesn't seem relevant to the specific scenario that Masahiko expressed concern about. Nor does it seem relevant to this patch more generally. -- Peter Geoghegan
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Recycle nbtree pages deleted during same VACUUM.
- 9dd963ae2534 14.0 landed
-
VACUUM VERBOSE: Count "newly deleted" index pages.
- 237636183909 14.0 landed
-
Use full 64-bit XIDs in deleted nbtree pages.
- e5d8a9990304 14.0 landed
-
Fix nbtree cleanup-only VACUUM stats inaccuracies.
- 48e1291342dd 14.0 cited
-
Fix undercounting in VACUUM VERBOSE output.
- 73a076b03f1c 13.0 cited
-
Delete empty pages in each pass during GIST VACUUM.
- 4e514c6180fb 13.0 cited
-
Use full 64-bit XID for checking if a deleted GiST page is old enough.
- 6655a7299d83 13.0 cited
-
Allow VACUUM to be run with index cleanup disabled.
- a96c41feec6b 12.0 cited
-
Skip full index scan during cleanup of B-tree indexes when possible
- 857f9c36cda5 11.0 cited
-
Do index FSM vacuuming sooner.
- c79f6df75dd3 11.0 cited
-
Avoid early reuse of btree pages, causing incorrect query results.
- d3abbbebe52e 9.2.0 cited
-
Clean up API for ambulkdelete/amvacuumcleanup as per today's discussion.
- e57345975cf8 8.2.0 cited