remove spurious CREATE INDEX CONCURRENTLY wait

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: remove spurious CREATE INDEX CONCURRENTLY wait
Date: 2020-08-10 23:38:15
Message-ID: 20200810233815.GA18970@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I previously[1] posted a patch to have multiple CREATE INDEX CONCURRENTLY
not wait for the slowest of them. This is an update of that, with minor
conflicts fixed and a fresh thread.

To recap: currently, any CREATE INDEX CONCURRENTLY will wait for all
other CICs running concurrently to finish, because they can't be
distinguished amidst other old snapshots. We can change things by
having CIC set a special flag in PGPROC (like PROC_IN_VACUUM) indicating
that it's doing CIC; other CICs will see that flag and will know that
they don't need to wait for those processes. With this, CIC on small
tables don't have to wait for CIC on large tables to complete.

[1] https://postgr.es/m/20200805021109.GA9079@alvherre.pgsql

--
Álvaro Herrera http://www.linkedin.com/in/alvherre
"Escucha y olvidarás; ve y recordarás; haz y entenderás" (Confucio)

Attachment Content-Type Size
0001-Flag-CREATE-INDEX-CONCURRENTLY-to-avoid-spurious-wai.patch text/x-diff 4.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-08-10 23:41:20 Re: remove spurious CREATE INDEX CONCURRENTLY wait
Previous Message Peter Eisentraut 2020-08-10 23:23:15 Re: Replace remaining StrNCpy() by strlcpy()