pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndquadrant.com>
To: Nikolas Everett <nik9000@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Exhaustive list of what takes what locks
Date: Wed, 02 Feb 2011 13:58:48 -0500
Message-ID: <4D49A968.3020800@2ndquadrant.com> (raw)
In-Reply-To: <AANLkTiksaoSZ03m_jALCBwhfogZxNA5_wKo_3J6ydBfF@mail.gmail.com>
References: <AANLkTiksaoSZ03m_jALCBwhfogZxNA5_wKo_3J6ydBfF@mail.gmail.com>

Nikolas Everett wrote:
> Is there an exhaustive list of what takes what locks and how long they 
> last?  I'm asking because we just had some trouble doing a hot db 
> change to an 8.3.6 system.  I know it is an old version but it is what 
> I have to work with.

There haven't been any major changes in this area since then, it 
wouldn't really matter if you were on a newer version.  The short answer 
to your question is that no, there is no such list.  The documentation 
at 
http://www.postgresql.org/docs/current/interactive/explicit-locking.html 
and 
http://www.postgresql.org/docs/current/interactive/view-pg-locks.html 
are unfortunately as good as it gets right now.  The subject is a bit 
more complicated even than it appears at first, given that you don't 
just need to take into account what statement is executing.  You need to 
know things like whether any foreign keys are involved as well as what 
index type is used (see 
http://www.postgresql.org/docs/current/interactive/locking-indexes.html 
) to fully predict what the locking situation for your SQL is going to 
become.  It's a fairly big grid of things to take into account.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books




view thread (13+ messages)  latest in thread

Message-ID: <4D49A968.3020800@2ndquadrant.com>
Permalink:  ../4D49A968.3020800@2ndquadrant.com/
Also on:    postgresql.org/message-id/4D49A968.3020800@2ndquadrant.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-performance@postgresql.org
  Cc: greg@2ndquadrant.com, nik9000@gmail.com
  Subject: Re: Exhaustive list of what takes what locks
  In-Reply-To: <4D49A968.3020800@2ndquadrant.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