4 ms·
Does not instill confidence when the queries they provide don't work. For anyone curious, the corrected query: SELECT sum(blks_hit)::numeric / nullif(sum(blks
by qeternity 8mo ago
Does not instill confidence when the queries they provide don't work.
For anyone curious, the corrected query:
SELECT sum(blks_hit)::numeric / nullif(sum(blks_hit + blks_read), 0) AS cache_hit_ratio FROM pg_stat_database;
- itiswatitis 8mo agoI just ran their query, and it works
- qeternity 8mo agoIt does not in PG17.
- bdd 8mo agoWorks on this Postgres 17.7: postgres=# show server_version; server_version ------------------------------- 17.7 (Debian 17.7-3.pgdg13+1) (1 row) postgres=# SELECT sum(blks_hit)/nullif(sum(blks_hit+blks_read),0) AS cache_hit_ratio FROM Pg_stat_database; cache_hit_ratio ------------------------ 0.99448341937558994728 (1 row)