Re: Allowing REINDEX to have an optional name

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Allowing REINDEX to have an optional name
Дата
Msg-id CANbhV-HzU3f4NkfS9O1+UuJA_HtKhEeNeu8zd54wmLv3G-dS0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Allowing REINDEX to have an optional name  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Ответы Re: Allowing REINDEX to have an optional name  (Cary Huang <cary.huang@highgo.ca>)
Re: Allowing REINDEX to have an optional name  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On Wed, 11 May 2022 at 05:24, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:

>> It is designed like this because it is dangerous to REINDEX the system
>> catalogs because of potential deadlocks, so we want a way to avoid
>> that problem.
>
> It's more clear if we add SKIP SYSTEM CATALOGS or some such explicit syntax.

Clarity is not the issue. I am opposed to a default mode that does
something bad and non-useful.

If you want to reindex the system catalogs then we already have REINDEX SYSTEM.
So REINDEX (SKIP_SYSTEM_CATALOGS OFF) DATABASE would do the same thing.
But you don't want to run either of them because of deadlocking.

The only action that makes sense is to reindex the database, skipping
the catalog tables.

So I'm proposing a command that has useful default behavior.
i.e. REINDEX DATABASE is the same as REINDEX (SKIP_SYSTEM_CATALOGS ON) DATABASE.

If you make REINDEX DATABASE the same as REINDEX (SKIP_SYSTEM_CATALOGS
OFF) DATABASE then it is just dangerous and annoying, i.e. a POLA
violation.

The point of this was a usability improvement, not just new syntax.

--
Simon Riggs                http://www.EnterpriseDB.com/



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: First draft of the PG 15 release notes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: First draft of the PG 15 release notes