pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: James Coleman <jtc331@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [DOC] Document concurrent index builds waiting on each other
Date: Sun, 29 Sep 2019 12:27:09 -0300
Message-ID: <20190929152709.GA25027@alvherre.pgsql> (raw)
In-Reply-To: <CAAaqYe9P95wxtoOaF0KozJsVMZ4Dxv8982x-uKAur8Umb1GkEg@mail.gmail.com>

On 2019-Sep-28, James Coleman wrote:

> I believe caveats like this are worth calling out rather than
> expecting users to have to understand the implementation details an
> work out the implications on their own.

I agree.

> I read Alvaro as referring to the fact that the docs already call out
> the following:
> 
> > Regular index builds permit other regular index builds on the same
> > table to occur simultaneously, but only one concurrent index build
> > can occur on a table at a time.

Yeah, that's what I was understanding.

BTW I think there's an approach that could alleviate part of this
problem, at least some of the time: whenever CIC runs for an index
that's not on expression and not partial, we could set the
PROC_IN_VACUUM flag.  That would cause it to get ignored by other
processes for snapshot purposes (including CIC itself), as well as by
vacuum.  I need to take some time to research the safety of this, but
intuitively it seems safe.

Even further, I think we could also do it for regular CREATE INDEX
(under the same conditions) provided that it's not run in a transaction
block.  But that requires even more research/proof.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (50+ messages)  latest in thread

Message-ID: <20190929152709.GA25027@alvherre.pgsql>
Permalink:  ../20190929152709.GA25027@alvherre.pgsql/
Also on:    postgresql.org/message-id/20190929152709.GA25027@alvherre.pgsql

 · 

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