On Wed, 11 May 2022 at 05:24, Ashutosh Bapat <ashutosh.ba...@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/