From a13bd14c670cdcc00b6630ace3f32662889b20ef Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 5 Aug 2020 16:51:29 +0100 Subject: [PATCH] updated postgres_query_hit_cache_ratio.sql --- sql/postgres_query_hit_cache_ratio.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/postgres_query_hit_cache_ratio.sql b/sql/postgres_query_hit_cache_ratio.sql index 664a052b..a0f31a03 100644 --- a/sql/postgres_query_hit_cache_ratio.sql +++ b/sql/postgres_query_hit_cache_ratio.sql @@ -28,6 +28,7 @@ SELECT -- using greatest() to avoid divide by zero error, by ensuring we divide by at least 1 shared_blks_hit / GREATEST((shared_blks_hit + shared_blks_read), 1)::float AS shared_blks_hit_ratio, + -- casting divisor to float to avoid getting integer maths returning zeros instead of fractional ratios local_blks_hit, local_blks_read, local_blks_hit /