From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: James Coleman <jtc331@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [DOC] Document concurrent index builds waiting on each other
Date: Sat, 28 Sep 2019 22:22:28 -0300
Message-ID: <20190929012228.GA21412@alvherre.pgsql> (raw)
In-Reply-To: <20190928161838.GD26853@momjian.us>
On 2019-Sep-28, Bruce Momjian wrote:
> The CREATE INDEX docs already say:
>
> In a concurrent index build, the index is actually entered into
> the system catalogs in one transaction, then two table scans occur in
> two more transactions. Before each table scan, the index build must
> wait for existing transactions that have modified the table to terminate.
> After the second scan, the index build must wait for any transactions
> --> that have a snapshot (see <xref linkend="mvcc"/>) predating the second
> --> scan to terminate. Then finally the index can be marked ready for use,
>
> So, having multiple concurrent index scans is just a special case of
> having to "wait for any transactions that have a snapshot", no? I am
> not sure adding a doc mention of other index builds really is helpful.
I always thought that create index concurrently was prevented from
running concurrently in a table by the ShareUpdateExclusive lock that's
held during the operation.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, bruce@momjian.us, jtc331@gmail.com
Subject: Re: [DOC] Document concurrent index builds waiting on each other
In-Reply-To: <20190929012228.GA21412@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox