Re:Unlocking high-performance PostgreSQL with key memory opt...
by itiswatitis on Friday February 06, 2026 @01:08PM
(#46916077)
I just ran their query, and it works
Re:Unlocking high-performance PostgreSQL with key memory opt...
by qeternity on Saturday February 07, 2026 @12:38PM
(#46925729)
It does not in PG17.
Re:Unlocking high-performance PostgreSQL with key memory opt...
by bdd on Sunday February 08, 2026 @04:04AM
(#46932648)
Works 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)
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;