pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: xu jian <jamesxu@outlook.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: blocking issue when create index concurrently
Date: Thu, 15 Dec 2016 12:33:37 -0500
Message-ID: <1878.1481823217@sss.pgh.pa.us> (raw)
In-Reply-To: <MWHPR20MB1421AEC7CEC67B159AC188F6A19A0@MWHPR20MB1421.namprd20.prod.outlook.com>
References: <MWHPR20MB1421AEC7CEC67B159AC188F6A19A0@MWHPR20MB1421.namprd20.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

xu jian <jamesxu@outlook.com> writes:
>           I was trying to create 2 indexes concurrently(on different table) in same database. I didn't expect the first create index operation would block the other one since they were running on different table.

> However, it is not true. I found one creating index command was blocking the other one.

There are (IIRC) two separate points in CREATE INDEX CONCURRENTLY where it
has to wait for all other transactions to exit.  That would include a
transaction running another CREATE INDEX (CONCURRENTLY), even if it's for
a different table.  I think running two at once would end in a deadlock
failure, since they would likely end up waiting for each other.

Usually, if you're using C.I.C., you're trying to minimize the impact
on the rest of the system, so running two at once seems a bit
counterproductive anyway.

			regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (2+ messages)

Message-ID: <1878.1481823217@sss.pgh.pa.us>
Permalink:  ../1878.1481823217@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1878.1481823217@sss.pgh.pa.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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jamesxu@outlook.com
  Subject: Re: blocking issue when create index concurrently
  In-Reply-To: <1878.1481823217@sss.pgh.pa.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