In this post we continue our discussion about postgres stats. This time we’ll be focusing on
pg_stat_database. As mentioned in postgres
documentation, this view contains one row for each database in the cluster, showing database-wide statistics. It is well known that postgres may have several databases within single instance, hence this view contains stats about all of them.
You can find full description of view’s columns in the official documentation so here I will focus on types of problems that it helps us to solve: