pgsql: vacuumlazy.c: Rename dead_tuples to dead_items. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: vacuumlazy.c: Rename dead_tuples to dead_items.
Date
Msg-id E1mrkwM-0007Q2-A2@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
vacuumlazy.c: Rename dead_tuples to dead_items.

Commit 8523492d simplified what it meant for an item to be considered
"dead" to VACUUM: TIDs collected in memory (in preparation for index
vacuuming) must always come from LP_DEAD stub line pointers in heap
pages, found following pruning.  This formalized the idea that index
vacuuming (and heap vacuuming) are optional processes.  Unlike pruning,
they can be delayed indefinitely, without any risk of that violating
fundamental invariants.  For example, leaving LP_DEAD items behind
clearly won't add to the risk of transaction ID wraparound.  You can't
have transaction ID wraparound without transaction IDs.  Renaming
anything that references DEAD tuples (tuples with storage) reinforces
all this.

Code outside vacuumlazy.c continues to fudge the distinction between
dead/deleted tuples, and LP_DEAD items.  This is necessary because
autovacuum scheduling is still mostly driven by "dead items/tuples"
statistics.  In the future we may find it useful to replace this model
with something more sophisticated, as a step towards teaching autovacuum
to perform more frequent vacuuming that targeting individual indexes
that happen to be more prone to becoming bloated through version churn.

In passing, simplify some function signatures that deal with VACUUM's
dead_items array.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CAH2-WzktGBg4si6DEdmq3q6SoXSDqNi6MtmB8CmmTmvhsxDTLA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4f8d9d1217956798e761491d236af576b27f5e12

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 349 +++++++++++++++++++----------------
1 file changed, 190 insertions(+), 159 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Doc: improve documentation about ORDER BY in matviews.
Next
From: Michael Paquier
Date:
Subject: pgsql: Fix compatibility thinko for fstat() on standard streams in win3