REINDEX backend filtering - Mailing list pgsql-hackers

From Julien Rouhaud
Subject REINDEX backend filtering
Date
Msg-id 20201203093143.GA64934@nol
Whole thread Raw
Responses Re: REINDEX backend filtering
List pgsql-hackers
Hello,

Now that we have the infrastructure to track indexes that might be corrupted
due to changes in collation libraries, I think it would be a good idea to offer
an easy way for users to reindex all indexes that might be corrupted.

I'm attaching a POC patch as a discussion basis.  It implements a new
"COLLATION" option to reindex, with "not_current" being the only accepted
value.  Note that I didn't spent too much efforts on the grammar part yet.

So for instance you can do:

REINDEX (COLLATION 'not_current') DATABASE mydb;

The filter is also implemented so that you could cumulate multiple filters, so
it could be easy to add more filtering, for instance:

REINDEX (COLLATION 'libc', COLLATION 'not_current') DATABASE mydb;

to only rebuild indexes depending on outdated libc collations, or

REINDEX (COLLATION 'libc', VERSION 'X.Y') DATABASE mydb;

to only rebuild indexes depending on a specific version of libc.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Single transaction in the tablesync worker?
Next
From: Daniel Gustafsson
Date:
Subject: Re: Online checksums patch - once again