Re: Exhaustive list of what takes what locks

From: Nikolas Everett <nik9000(at)gmail(dot)com>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Exhaustive list of what takes what locks
Date: 2011-02-02 19:53:49
Message-ID: AANLkTinvD7oMyQrArK+XiwZ7cbvzVH5ba+JLz_8C2emh@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Given that the a list would be difficult to maintain, is there some way I
can make Postgres spit out the list of what locks are taken?

--Nik

On Wed, Feb 2, 2011 at 1:58 PM, Greg Smith <greg(at)2ndquadrant(dot)com> wrote:

> 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.htmland
> 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(at)2ndQuadrant(dot)com Baltimore, MD
> PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
> "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Nikolas Everett 2011-02-02 20:29:50 Re: Exhaustive list of what takes what locks
Previous Message John Rouillard 2011-02-02 19:51:01 Re: Are we in the ballpark?