Re: vacuumdb and new VACUUM options

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: vacuumdb and new VACUUM options
Дата
Msg-id 20190517020922.GJ20887@paquier.xyz
обсуждение исходный текст
Ответ на Re: vacuumdb and new VACUUM options  (Masahiko Sawada <sawada.mshk@gmail.com>)
Ответы Re: vacuumdb and new VACUUM options  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-hackers
On Wed, May 15, 2019 at 03:44:22PM +0900, Masahiko Sawada wrote:
> I've attached new version patch that takes the way to let the backend
> parser do all work.

I was wondering how the error handling gets by not having the parsing
on the frontend, and it could be worse:
$ vacuumdb --index-cleanup=popo
vacuumdb: vacuuming database "postgres"
vacuumdb: error: vacuuming of table "pg_catalog.pg_proc" in database
"postgres" failed: ERROR:  index_cleanup requires a Boolean value
$ vacuumdb --truncate=popo
vacuumdb: vacuuming database "postgres"
vacuumdb: error: vacuuming of table "pg_catalog.pg_proc" in database
"postgres" failed: ERROR:  truncate requires a Boolean value

For TRUNCATE, we actually get to the same error, and INDEX_CLEANUP
just defers with the separator between the two terms.  I think that we
could live with that for simplicity's sake.  Perhaps others have
different opinions though.

+       if (vacopts.index_cleanup != NULL)
Checking directly for NULL-ness here is inconsistent with the previous
callers.

+$node->issues_sql_like(
+   [ 'vacuumdb', '--index-cleanup=true', 'postgres' ],
+   qr/statement: VACUUM \(INDEX_CLEANUP true\).*;/,
+   'vacuumdb --index-cleanup=true')
We should have a failure test here instead of testing two times the
same boolean parameter with opposite values to make sure that we still
complain on invalid input values.

+         Specify that <command>VACUUM</command> should attempt to remove
+         index entries pointing to dead tuples. If this option is not specified
+         the behavior depends on <literal>vacuum_index_cleanup</literal> option
+         for the table to be vacuumed.
The description of other commands do not mention directly VACUUM, and
have a more straight-forward description about the goal of the option.
So the first sentence could be reworked as follows:
Removes index entries pointing to dead tuples.

And the second for --truncate:
Truncates any empty pages at the end of the relation.

My 2c.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pglz performance
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Statistical aggregate functions are not working with PARTIALaggregation