Hello,
In a previous thread [1], we added smarts so that processes running
CREATE INDEX CONCURRENTLY would not wait for each other.
One is adding the same to REINDEX CONCURRENTLY. I've attached patch
0002 here which does that.
Why 0002, you ask? That's because preparatory patch 0001 simplifies the
ReindexRelationConcurrently somewhat by adding a struct to be used of
indexes that are going to be processed, instead of just a list of Oids.
This is a good change in itself because it let us get rid of duplicative
open/close of the index rels in order to obtain some info that's already
known at the start.
The other thing is that it'd be good if we can make VACUUM also ignore
Xmin of processes doing CREATE INDEX CONCURRENTLY and REINDEX
CONCURRENTLY, when possible. I have two possible ideas to handle this,
about which I'll post later.
[1] https://postgr.es/m/20200810233815.GA18970@alvherre.pgsql
--
Álvaro Herrera Valdivia, Chile