pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c
3+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2017-10-05 4d85c2900b  Improve comments in vacuum_rel() and analyze_rel().
* pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c
@ 2017-10-03 22:53 Tom Lane <tgl@sss.pgh.pa.us>
  2017-10-05 04:55 ` Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2017-10-03 22:53 UTC (permalink / raw)
  To: pgsql-committers

Allow multiple tables to be specified in one VACUUM or ANALYZE command.

Not much to say about this; does what it says on the tin.

However, formerly, if there was a column list then the ANALYZE action was
implied; now it must be specified, or you get an error.  This is because
it would otherwise be a bit unclear what the user meant if some tables
have column lists and some don't.

Nathan Bossart, reviewed by Michael Paquier and Masahiko Sawada, with some
editorialization by me

Discussion: https://postgr.es/m/E061A8E3-5E3D-494D-94F0-E8A9B312BBFC@amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/11d8d72c27a64ea4e30adce11cf6c4f3dd3e60db

Modified Files
--------------
doc/src/sgml/ref/analyze.sgml        |  14 ++-
doc/src/sgml/ref/vacuum.sgml         |  36 ++++--
src/backend/commands/vacuum.c        | 236 +++++++++++++++++++++++------------
src/backend/nodes/copyfuncs.c        |  14 +++
src/backend/nodes/equalfuncs.c       |  12 ++
src/backend/nodes/makefuncs.c        |  15 +++
src/backend/parser/gram.y            |  71 ++++-------
src/backend/postmaster/autovacuum.c  |  20 +--
src/include/commands/vacuum.h        |   3 +-
src/include/nodes/makefuncs.h        |   2 +
src/include/nodes/nodes.h            |   1 +
src/include/nodes/parsenodes.h       |  22 +++-
src/test/regress/expected/vacuum.out |  23 +++-
src/test/regress/sql/vacuum.sql      |  19 ++-
14 files changed, 329 insertions(+), 159 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c
  2017-10-03 22:53 pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-10-05 04:55 ` Michael Paquier <michael.paquier@gmail.com>
  2017-10-05 14:52   ` Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Paquier @ 2017-10-05 04:55 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>

On Wed, Oct 4, 2017 at 7:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Allow multiple tables to be specified in one VACUUM or ANALYZE command.
>
> Not much to say about this; does what it says on the tin.
>
> However, formerly, if there was a column list then the ANALYZE action was
> implied; now it must be specified, or you get an error.  This is because
> it would otherwise be a bit unclear what the user meant if some tables
> have column lists and some don't.
>
> Nathan Bossart, reviewed by Michael Paquier and Masahiko Sawada, with some
> editorialization by me

Tom, it seems to me that in the portions you have editorialized, you
have forgotten to update two comments still mentioning get_rel_oids()
in vacuum.c and analyze.c. Those should now refer to
expand_vacuum_rel() instead. Please see the attached.
-- 
Michael

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

vacuum-fix-comments.patch (application/octet-stream, 1.2K) download diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index d432f8208d..2b8de85e14 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -208,8 +208,8 @@ analyze_rel(Oid relid, RangeVar *relation, int options, /* * Check that it's a plain table, materialized view, or foreign table; we - * used to do this in get_rel_oids() but seems safer to check after we've - * locked the relation. + * used to do this in expand_vacuum_rel() but seems safer to check after + * we've locked the relation. */ if (onerel->rd_rel->relkind == RELKIND_RELATION || onerel->rd_rel->relkind == RELKIND_MATVIEW) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index f439b55ea5..3db96cac11 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -1445,7 +1445,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params) /* * Check that it's a vacuumable relation; we used to do this in - * get_rel_oids() but seems safer to check after we've locked the + * expand_vacuum_rel() but seems safer to check after we've locked the * relation. */ if (onerel->rd_rel->relkind != RELKIND_RELATION &&
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c
  2017-10-03 22:53 pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Tom Lane <tgl@sss.pgh.pa.us>
  2017-10-05 04:55 ` Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Michael Paquier <michael.paquier@gmail.com>
@ 2017-10-05 14:52   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-10-05 14:52 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>

Michael Paquier <michael.paquier@gmail.com> writes:
> Tom, it seems to me that in the portions you have editorialized, you
> have forgotten to update two comments still mentioning get_rel_oids()
> in vacuum.c and analyze.c. Those should now refer to
> expand_vacuum_rel() instead. Please see the attached.

Oh, good point.  I don't think that just s/get_rel_oids/expand_vacuum_rel/
will do though, as it leaves out the interaction with get_all_vacuum_rels.
I decided that the point was of merely historical interest anyway, and
just removed the reference to the other routine.

The partitioned-table patches seem to have been a bit sloppy with
maintaining these comments too, so I ended up doing more than that...

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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


end of thread, other threads:[~2017-10-05 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-03 22:53 pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c Tom Lane <tgl@sss.pgh.pa.us>
2017-10-05 04:55 ` Michael Paquier <michael.paquier@gmail.com>
2017-10-05 14:52   ` Tom Lane <tgl@sss.pgh.pa.us>

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