Re: RFC: replace pg_stat_activity.waiting with something more descriptive

Поиск
Список
Период
Сортировка
От Ildus Kurbangaliev
Тема Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Дата
Msg-id 55AE1AD8.8040409@postgrespro.ru
обсуждение исходный текст
Ответ на Re: RFC: replace pg_stat_activity.waiting with something more descriptive  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Ответы Re: RFC: replace pg_stat_activity.waiting with something more descriptive  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hello.
I did some refactoring to previous patch. Improvements:

1) Wait is determined by class and event without affecting to atomic usage of it. 
They are still stored in one variable. This improvement gives an opportunity to make  
more detailed views later (waits can be grouped by class).
2) Only active wait of each backend is visible. pg_report_wait_end() function called
on the end of wait and clears it.
3) Wait name determination was optimized (last version used cycles for each of them, 
and was very heavy). I added lazy `group` field to LWLock, which used as index in
lwlock names array.
4) New wait can be added by more simpler way. For example an individual lwlock
requires only specifying its name in LWLock names arrayb
5) Added new types of waits: Storage, Network, Latch

This patch is more informative and it'll be easier to extend.

Sample:

b1=# select pid, wait_event from pg_stat_activity;

pid  |          wait_event          
-------+------------------------------
17099 | LWLocks: BufferCleanupLock
17100 | Locks: Transaction
17101 | LWLocks: BufferPartitionLock
17102 | 
17103 | Network: READ
17086 | 
(6 rows)

-- 
Ildus Kurbangaliev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: "make check" changes have caused buildfarm deterioration.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: RFC: replace pg_stat_activity.waiting with something more descriptive