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
firstcreate 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