REINDEX backend filtering

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: REINDEX backend filtering
Date: 2020-12-03 09:31:43
Message-ID: 20201203093143.GA64934@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v1-0001-Add-a-new-COLLATION-option-to-REINDEX.patch text/plain 10.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2020-12-03 09:37:58 Re: Online checksums patch - once again
Previous Message Amit Kapila 2020-12-03 09:27:08 Single transaction in the tablesync worker?