{CREATE INDEX, REINDEX} CONCURRENTLY improvements

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, James Coleman <jtc331(at)gmail(dot)com>
Subject: {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Date: 2020-11-30 19:54:39
Message-ID: 20201130195439.GA24598@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-create-ReindexIndexInfo.patch text/x-diff 11.5 KB
0002-set-PROC_IN_SAFE_IC-during-REINDEX-CONCURRENTLY.patch text/x-diff 6.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anastasia Lubennikova 2020-11-30 20:03:33 Re: [DOC] Document concurrent index builds waiting on each other
Previous Message Peter Geoghegan 2020-11-30 19:50:58 Re: Deleting older versions in unique indexes to avoid page splits