Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael.paquier@gmail.com>
Date: 2017-05-18T05:45:42Z
Lists: pgsql-hackers
On Thu, May 18, 2017 at 7:38 AM, Bossart, Nathan <bossartn@amazon.com> wrote: > I’ve attached a v4 of the patch. > > Changes: > - Early in vacuum(…), emit an ERROR if any specified columns do not exist. > - Emit a WARNING and skip any specified tables or columns that disappear before they are actually processed. > - Small additions to the VACUUM regression test. > - Rebased with master. > Thank you for updating the patch. Some review comments. I got the following warning messages when building. You might want to include parser/parse_relation.h. vacuum.c: In function ‘check_columns_exist’: vacuum.c:567: warning: implicit declaration of function ‘attnameAttNum’ -- =# vacuum (verbose) hoge, hoge; INFO: vacuuming "public.hoge" INFO: "hoge": found 0 removable, 0 nonremovable row versions in 0 out of 0 pages DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 604 There were 0 unused item pointers. Skipped 0 pages due to buffer pins, 0 frozen pages. 0 pages are entirely empty. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. INFO: vacuuming "public.hoge" INFO: "hoge": found 0 removable, 0 nonremovable row versions in 0 out of 0 pages DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 604 There were 0 unused item pointers. Skipped 0 pages due to buffer pins, 0 frozen pages. 0 pages are entirely empty. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. VACUUM Even if the same relation is specified more than once, we should vacuum the relation only once. Similarly if we specify the parent table and its child table we want to vacuum each relation only once. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
Commits
-
Allow multiple tables to be specified in one VACUUM or ANALYZE command.
- 11d8d72c27a6 11.0 landed
-
Give a better error for duplicate entries in VACUUM/ANALYZE column list.
- ea31541f5648 9.6.6 landed
- e56facd8b300 9.2.24 landed
- b572b435ca67 9.4.15 landed
- a2b1eb23496e 10.0 landed
- a09d8be7ddaf 9.3.20 landed
- 71480501057f 11.0 landed
- 122289a66b92 9.5.10 landed
-
Reject ANALYZE commands during VACUUM FULL or another ANALYZE.
- e415b469b33b 9.5.0 cited