Is there anything in Postgresql 9.1 similar to wait events dynamic views of oracle? I need to find queries which are waiting for a long time, and the events they are blocked on.
2 Answers 2
There isn't such a fine grained tracking available in Postgres (other than using DTrace which apparently gives a lot of information).
There is a whole chapter in the manual "Monitoring Database Activity"
http://www.postgresql.org/docs/current/static/monitoring.html
Another option is the module pg_stats_statements:
http://www.postgresql.org/docs/current/static/pgstatstatements.html
For 9.6 and 10 you can try PASH-Viewer to observe wait events in the chart. You can see top sql queries and top sessions in period of time.
It's free and open source. enter image description here
Screenshots: https://habrastorage.org/webt/4h/ac/nv/4hacnv4ty2shh41gw3srzhp9t0i.png https://habrastorage.org/webt/f2/4s/yt/f24sytk_inxgiav3wuajcjjifro.png https://habrastorage.org/webt/lw/yp/kg/lwypkg-wu4timhbp6ge7p3nf8ok.png
-
2Just to clarify - from the GitHub link, are you involved in this product? If so, you should probably make note of that.RDFozz– RDFozz2018年06月08日 16:26:24 +00:00Commented Jun 8, 2018 at 16:26
-
Yes, i took an opensource product for Oracle (ash-viewer) and rewrited it for postgresql.dcvetkov– dcvetkov2018年06月09日 16:48:03 +00:00Commented Jun 9, 2018 at 16:48