pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: James Coleman <jtc331@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [DOC] Document concurrent index builds waiting on each other
Date: Sat, 28 Sep 2019 21:56:24 -0400
Message-ID: <20190929015624.GA19872@momjian.us> (raw)
In-Reply-To: <CAAaqYe-7n=eZU265QL_=4kueTggx4_Ewh_xgfRYEBrBpQDLyrA@mail.gmail.com>
References: <20190928161838.GD26853@momjian.us>
	<20190929012228.GA21412@alvherre.pgsql>
	<CAAaqYe-7n=eZU265QL_=4kueTggx4_Ewh_xgfRYEBrBpQDLyrA@mail.gmail.com>

On Sat, Sep 28, 2019 at 09:54:48PM -0400, James Coleman wrote:
> On Sat, Sep 28, 2019 at 9:22 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> >
> > 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.
> 
> You mean multiple CICs on a single table at the same time? Yes, that
> (unfortunately) isn't possible, but I'm concerned in the patch with
> the fact that CIC on table X blocks CIC on table Y.

I think any open transaction will block CIC, which is my point.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +





view thread (50+ messages)  latest in thread

Message-ID: <20190929015624.GA19872@momjian.us>
Permalink:  ../20190929015624.GA19872@momjian.us/
Also on:    postgresql.org/message-id/20190929015624.GA19872@momjian.us

 · 

reply

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: bruce@momjian.us, jtc331@gmail.com, alvherre@2ndquadrant.com
  Subject: Re: [DOC] Document concurrent index builds waiting on each other
  In-Reply-To: <20190929015624.GA19872@momjian.us>

* 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