pgsql: Rationalize vacuuming options and parameters - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Rationalize vacuuming options and parameters
Date
Msg-id E1YYHzO-00055Q-89@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Rationalize vacuuming options and parameters

We were involving the parser too much in setting up initial vacuuming
parameters.  This patch moves that responsibility elsewhere to simplify
code, and also to make future additions easier.  To do this, create a
new struct VacuumParams which is filled just prior to vacuum execution,
instead of at parse time; for user-invoked vacuuming this is set up in a
new function ExecVacuum, while autovacuum sets it up by itself.

While at it, add a new member VACOPT_SKIPTOAST to enum VacuumOption,
only set by autovacuum, which is used to disable vacuuming of the toast
table instead of the old do_toast parameter; this relieves the argument
list of vacuum() and some callees a bit.  This partially makes up for
having added more arguments in an effort to avoid having autovacuum from
constructing a VacuumStmt parse node.

Author: Michael Paquier. Some tweaks by Álvaro
Reviewed by: Robert Haas, Stephen Frost, Álvaro Herrera

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0d831389749a3baaced7b984205b9894a82444b9

Modified Files
--------------
src/backend/commands/analyze.c      |   32 ++++-----
src/backend/commands/vacuum.c       |  125 +++++++++++++++++++++++------------
src/backend/commands/vacuumlazy.c   |   13 ++--
src/backend/nodes/copyfuncs.c       |    4 --
src/backend/nodes/equalfuncs.c      |    4 --
src/backend/parser/gram.y           |   50 ++------------
src/backend/postmaster/autovacuum.c |   58 ++++++----------
src/backend/tcop/utility.c          |    2 +-
src/include/commands/vacuum.h       |   28 ++++++--
src/include/nodes/parsenodes.h      |   13 +---
10 files changed, 159 insertions(+), 170 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pgsql: Remove pause_at_recovery_target recovery.conf setting.
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Setup cursor position for schema-qualified elements