Re: determining the locks that will be held by a query

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Brian Cox" <brian(dot)cox(at)ca(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: determining the locks that will be held by a query
Date: 2009-04-10 20:02:18
Message-ID: 49DF5F7A.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Brian Cox <brian(dot)cox(at)ca(dot)com> wrote:
> I know that EXPLAIN will show the query plan. I know that pg_locks
> will show the locks currently held for activity transactions. Is
> there a way to determine what locks a query will hold when it is
> executed?

Only to read the docs regarding locking, and to desk-check your query,
at least as far as I know.

Keep in mind that some statements will only obtain locks if they find
rows that are affected, which might vary from one run to the next.

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Glyn Astill 2009-04-10 20:06:12 2.6.26 kernel and PostgreSQL
Previous Message Greg Smith 2009-04-10 19:25:01 Re: Using IOZone to simulate DB access patterns