pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: foreign key locks
Date: Sat, 17 Nov 2012 13:25:07 -0500
Message-ID: <20121117182507.GB32086@tornado.leadboat.com> (raw)
In-Reply-To: <20121117160718.GA5675@awork2.anarazel.de>
References: <20121018195820.GO3763@alvh.no-ip.org>
	<201210270006.54728.andres@2ndquadrant.com>
	<20121114152347.GA5161@alvh.no-ip.org>
	<20121114162726.GE5161@alvh.no-ip.org>
	<20121116002459.GB4347@tornado.leadboat.com>
	<20121116161747.GC4454@alvh.no-ip.org>
	<20121116163112.GF6505@awork2.anarazel.de>
	<20121117033151.GB24972@tornado.leadboat.com>
	<20121117142020.GB4222@awork2.anarazel.de>
	<20121117160718.GA5675@awork2.anarazel.de>

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.




view thread (74+ messages)  latest in thread

Message-ID: <20121117182507.GB32086@tornado.leadboat.com>
Permalink:  ../20121117182507.GB32086@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20121117182507.GB32086@tornado.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, andres@2ndquadrant.com, alvherre@2ndquadrant.com
  Subject: Re: foreign key locks
  In-Reply-To: <20121117182507.GB32086@tornado.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox