Skip site navigation (1) Skip section navigation (2)

Re: foreign key locks

From: Noah Misch <noah(at)leadboat(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: foreign key locks
Date: 2012-11-17 18:25:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sat, Nov 17, 2012 at 05:07:18PM +0100, Andres Freund wrote:
> > > I agree that tripling FOR SHARE cost is risky.  Where is the added cost
> > > concentrated?  Perchance that multiple belies optimization opportunities.
> >
> > Good question, let me play a bit.
> Ok, I benchmarked around and from what I see there is no single easy
> target.
> The biggest culprits I could find are:
> 1. higher amount of XLogInsert calls per transaction (visible
> in pgbench -t instead of -T mode while watching the WAL volume)
> 2. Memory allocations in GetMultiXactIdMembers
> 3. Memory allocations in mXactCachePut
>  a) cache entry itself
>  b) the cache context
> 4. More lwlocks acquisitions
> We can possibly optimize a bit with 2) by using a static buffer for
> common member sizes, but thats not going to buy us too much...

In that case, +1 for your proposal to prop up FOR SHARE.

In response to

pgsql-hackers by date

Next:From: Fujii MasaoDate: 2012-11-17 21:23:22
Subject: Re: another idea for changing global configuration settings from SQL
Previous:From: Philip TaylorDate: 2012-11-17 18:05:40
Subject: array exclusion constraint

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group