Essential Queries for PostgreSQL Health Assessment
In this post, we’ll look at a few crucial queries that are helpful for exploring into PostgreSQL problems and evaluating the health of an existing instance. What is hit ratio of the database?
| 1 2 3 4 5 6 7 8 9 10 11 | SELECT datname, ( blks_hit * 100 /(blks_hit + blks_read) ):: numeric as hit_ratio from pg_stat_database WHERE datname not in ( 'postgres', 'template0', 'template1' ); |
If the hit ratio is less than 90%, there may be a problem with low allocation of shared buffers or queries…

