Re: [DOC] Document concurrent index builds waiting on each other

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [DOC] Document concurrent index builds waiting on each other
Date: 2019-09-29 01:22:28
Message-ID: 20190929012228.GA21412@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-09-29 01:38:08 Re: Wrong results using initcap() with non normalized string
Previous Message James Coleman 2019-09-28 23:21:33 Re: Consider low startup cost in add_partial_path