pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Tim Bunce <Tim.Bunce@pobox.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Brian Cox <brian.cox@ca.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: "slow" queries
Date: Mon, 2 Mar 2009 14:59:47 -0700
Message-ID: <dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.com> (raw)
In-Reply-To: <20090302212433.GX8731@timac.local>
References: <49AC23FF.9070103@ca.com>
	<22227.1236022171@sss.pgh.pa.us>
	<20090302212433.GX8731@timac.local>

On Mon, Mar 2, 2009 at 2:24 PM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
> On Mon, Mar 02, 2009 at 02:29:31PM -0500, Tom Lane wrote:
>> Brian Cox <brian.cox@ca.com> writes:
>> > select locktype,database,relation,virtualxid,virtualtransaction,pid,mode
>> > from pg_locks order by mode;
>>
>> If you hadn't left out the "granted" column we could be more sure,
>> but what it looks like to me is the DROP (pid 13842) is stuck behind
>> the <IDLE> transaction (pid 13833).  In particular these two rows of
>> pg_locks look like a possible conflict:
>>
>> >   relation      | 26472437 | 26472508 |            | 15/69749
>> > | 13842 | AccessExclusiveLock
>>
>> >   relation      | 26472437 | 26472508 |            | 11/131
>> > | 13833 | AccessShareLock
>
> Would it be possible to write a stored procedure that would read
> pg_locks, and other relevant tables, and list what's blocking what
> in a simplified form?

I'm sure a query could use just connect by from tablefuncs, or WITH
under 8.4 and get it.




view thread (14+ messages)

Message-ID: <dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.com>
Permalink:  ../dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.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: scott.marlowe@gmail.com, Tim.Bunce@pobox.com, tgl@sss.pgh.pa.us, brian.cox@ca.com
  Subject: Re: "slow" queries
  In-Reply-To: <dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.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