Re: Lock Statistics

Поиск
Список
Период
Сортировка
От adey
Тема Re: Lock Statistics
Дата
Msg-id 1c66bda80707301535s24e675f4i483b06f91351289e@mail.gmail.com
обсуждение исходный текст
Ответ на Lock Statistics  ("Milen A. Radev" <milen@radev.net>)
Ответы Re: Lock Statistics  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-admin
Try this query for a start, and add system tables to the join to find what you want:-
 

-- displays locks with database name and username, but not table

-- CAUTION: this query may impact system performance as you are selecting from system tables

select

relation

, c.relname

, u.usename

, pid

, mode

, transaction

, granted

, datname

, u.usesysid

, usesuper

--*

from pg_locks l, pg_stat_activity s, pg_user u , pg_class c

where l.pid = s. procpid

and l.relation = c .relfilenode

and s.usesysid = u .usesysid

order by l.pid;

 

On 7/31/07, Milen A. Radev <milen@radev.net> wrote:
I have performance problems with a DB (slow queries) and I suspect the
main cause is that a lot of queries wait for a lock on one small
table. That's why I need some stats about the number and (average)
wait-time for locks (even only for this particular table).

After a bit of googling I found a project in PgFoundry with a
promising description - http://pgfoundry.org/projects/pglockdiag/.
Unfortunately the projects seems stillborn - no published files and
nothing in CVS.


--
Milen A. Radev

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

В списке pgsql-admin по дате отправления:

Предыдущее
От: NetComrade
Дата:
Сообщение: Re: Question about Postgres
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Lock Statistics