Re: Partial index locks - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Partial index locks
Date
Msg-id 532CE07F.5000708@dalibo.com
Whole thread Raw
In response to Partial index locks  (Thom Brown <thom@linux.com>)
Responses Re: Partial index locks
Re: Partial index locks
List pgsql-hackers
On 03/22/2014 01:43 AM, Thom Brown wrote:
> 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?

What if the update puts the row into one of the other indexes?

-- 
Vik




pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Partial index locks
Next
From: "David E. Wheeler"
Date:
Subject: Re: psql blows up on BOM character sequence