Re: foreign key locks - Mailing list pgsql-hackers

From Robert Haas
Subject Re: foreign key locks
Date
Msg-id CA+TgmoaA962qucoiJKb+=NSmRyBppwDdbLnf6cF5=h1=7vQRtg@mail.gmail.com
Whole thread Raw
In response to Re: foreign key locks  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Wed, Aug 22, 2012 at 5:31 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Patch v19 contains some tweaks.  Most notably,
>
> 1. if an Xid requests a lock A, and then a lock B which is stronger than
> A, then record only lock B and forget lock A.  This is important for
> performance, because EvalPlanQual obtains ForUpdate locks on the tuples
> that it chases on an update chain.  If EPQ was called by an update or
> delete, previously a MultiXact was being created.
>
> In a stock pgbench run this was causing lots of multis to be created,
> even when there are no FKs.
>
> This was most likely involved in the 9% performance decrease that was
> previously reported.

Ah-ha!  Neat.  I'll try to find some time to re-benchmark this during
the next CF, unless you did that already.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: NOT NULL constraints in foreign tables
Next
From: Tom Lane
Date:
Subject: Re: plperl sigfpe reset can crash the server