Currently, PostgreSQL offers many metrics for monitoring. However, detailed monitoring of waits is still not supported yet. Such monitoring would let dba know how long backend waited for particular event and therefore identify bottlenecks. This functionality is very useful, especially for highload databases. Metric for waits monitoring are provided by many popular commercial DBMS. We currently have requests of this feature from companies migrating to PostgreSQL from commercial DBMS. Thus, I think it would be nice for PostgreSQL to have it too.
Yes, It is good have such wait monitoring views in PostgreSQL. you can add this patch to the open commitfest.
Robert and Amit proposed very similar idea and its patch is now being reviewed in the current CommitFest. So I think that you should attend that discussion rather than starting new one.
This thread raising waits monitoring problem much more general than just adding one more column to pg_stat_activity. This patch contains profiling, history and much more details about current wait events. We appreciate joint work in this direction, but we have just started with publishing our current work and raise waits monitoring question in its full weight.
Ildus,
I see that patch of Robert and Amit adds current lock type into PgBackendStatus and, in turn, adds it into pg_stat_activity. This is small part of what you implement in waits monitoring patch. Dividing big features into small pieces makes it much easier to include PostgreSQL. I think you should join work of Robert and Amit in inclusion current lock type into PgBackendStatus. There are things you could help them to improve. And then you can rebase waits monitoring patch according to it.
------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company