From 189106fdb91121e2f7ba0f2b5dd1552cb0886a8c Mon Sep 17 00:00:00 2001 From: Michael Renner Date: Wed, 3 Apr 2013 12:40:39 +0200 Subject: bloat query: fix totalwastedbytes totalwastedbytes returned only the number of wasted pages - fix that by multiplying with the blocksize --- check_postgres.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index d11dc5d76..6482aa407 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3531,9 +3531,9 @@ SELECT CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes, CASE WHEN ipages < iotta THEN '0 bytes' ELSE (bs*(ipages-iotta))::bigint || ' bytes' END AS wastedisize, CASE WHEN relpages < otta THEN - CASE WHEN ipages < iotta THEN 0 ELSE ipages-iotta::bigint END - ELSE CASE WHEN ipages < iotta THEN relpages-otta::bigint - ELSE relpages-otta::bigint + ipages-iotta::bigint END + CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta::bigint) END + ELSE CASE WHEN ipages < iotta THEN bs*(relpages-otta::bigint) + ELSE bs*(relpages-otta::bigint + ipages-iotta::bigint) END END AS totalwastedbytes FROM ( SELECT -- cgit v1.2.3