| From: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
|---|---|
| To: | Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Brian Cox <brian(dot)cox(at)ca(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
| Subject: | Re: "slow" queries |
| Date: | 2009-03-02 21:59:47 |
| Message-ID: | dcc563d10903021359n2824c763r36f31abb2063a403@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
On Mon, Mar 2, 2009 at 2:24 PM, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com> wrote:
> On Mon, Mar 02, 2009 at 02:29:31PM -0500, Tom Lane wrote:
>> Brian Cox <brian(dot)cox(at)ca(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aaron Guyon | 2009-03-03 00:18:30 | Postgres 8.3, four times slower queries? |
| Previous Message | Tim Bunce | 2009-03-02 21:24:33 | Re: "slow" queries |