Partial index locks

From: Thom Brown <thom(at)linux(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Partial index locks
Date: 2014-03-22 00:43:37
Message-ID: CAA-aLv4QTcSP5fG=G7pPFq9vcOyEUXni_s0q4jjCFFZt3_p3qA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've created a table with 1000 partial indexes. Each one matches
exactly one row based on the predicate WHERE id = <value>.

However, when I perform an UPDATE of a single row in a transaction,
I've noticed that all those partial indexes show up in pg_locks with
RowExclusiveLock.

Only 2 of those indexes have a reference to the row: the primary key
and a single partial index.

Is it necessary for a partial index that doesn't include the row to be
involved in locking?

Thanks

Thom

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2014-03-22 00:59:43 Re: Partial index locks
Previous Message Tatsuo Ishii 2014-03-22 00:33:32 Re: Standby server won't start