Question

I'm working on small tool for gathering information about our postgres database and I have been looking at using the postgres Stats Collecter. It seems like there is a lot of info/stats in the table but I am having trouble understanding what exactly it all means.

If someone has used these views before would they be able to point me in the right direction for how to obtain stats such as the number of currently running queries or the slowest query? If these aren't possible from the postgres stats collector is there some other method for obtaining statistics that I could use?

One other thing I was confused about is if the stats collector limits the amount of data: for instance, will it only record the last x server processes?

Was it helpful?

Solution

I suggest you look at what other monitoring tools already run - such as Munin or check_postgres for Nagios.

Specifically, for what you're asking here, look at the view pg_stat_activity.

And no, the stats collector tracks everything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top