pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Simplify state managed by VACUUM.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Simplify state managed by VACUUM.
@ 2021-04-05 20:27 Peter Geoghegan <pg@bowt.ie>
  2021-04-05 20:48 ` Re: pgsql: Simplify state managed by VACUUM. Peter Geoghegan <pg@bowt.ie>
  0 siblings, 1 reply; 2+ messages in thread

From: Peter Geoghegan @ 2021-04-05 20:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Simplify state managed by VACUUM.

Reorganize the state struct used by VACUUM -- group related items
together to make it easier to understand.  Also stop relying on stack
variables inside lazy_scan_heap() -- move those into the state struct
instead.  Doing things this way simplifies large groups of related
functions whose function signatures had a lot of unnecessary redundancy.

Switch over to using int64 for the struct fields used to count things
that are reported to the user via log_autovacuum and VACUUM VERBOSE
output.  We were using double, but that doesn't seem to have any
advantages.  Using int64 makes it possible to add assertions that verify
that the first pass over the heap (pruning) encounters precisely the
same number of LP_DEAD items that get deleted from indexes later on, in
the second pass over the heap.  These assertions will be added in later
commits.

Finally, adjust the signatures of functions with IndexBulkDeleteResult
pointer arguments in cases where there was ambiguity about whether or
not the argument relates to a single index or all indexes.  Functions
now use the idiom that both ambulkdelete() and amvacuumcleanup() have
always used (where appropriate): accept a mutable IndexBulkDeleteResult
pointer argument, and return a result IndexBulkDeleteResult pointer to
caller.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b4af70cb210393c9c8f41643acf6b213e21178e7

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 1442 ++++++++++++++++++----------------
src/backend/access/index/indexam.c   |    8 +-
src/backend/commands/vacuum.c        |   76 +-
src/include/access/genam.h           |    4 +-
src/include/access/heapam.h          |    2 +-
src/include/access/tableam.h         |    2 +-
6 files changed, 814 insertions(+), 720 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Simplify state managed by VACUUM.
  2021-04-05 20:27 pgsql: Simplify state managed by VACUUM. Peter Geoghegan <pg@bowt.ie>
@ 2021-04-05 20:48 ` Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Geoghegan @ 2021-04-05 20:48 UTC (permalink / raw)
  To: pgsql-committers <pgsql-committers@lists.postgresql.org>

On Mon, Apr 5, 2021 at 1:27 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Simplify state managed by VACUUM.

I'm investigating the buildfarm failures on elver, curculio, and morepork.

-- 
Peter Geoghegan





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-04-05 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 20:27 pgsql: Simplify state managed by VACUUM. Peter Geoghegan <pg@bowt.ie>
2021-04-05 20:48 ` Peter Geoghegan <pg@bowt.ie>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox