From eba4515da0ccb77160e2041436cfcc58d12ab1af Mon Sep 17 00:00:00 2001 From: Ryan P. Kelly Date: Thu, 17 May 2012 18:10:34 -0400 Subject: Restore totalwastedbytes --- check_postgres.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index 2a3e46b7d..7e03472fa 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3527,7 +3527,12 @@ SELECT ROUND(CASE WHEN iotta=0 OR ipages=0 OR ipages=iotta THEN 0.0 ELSE ipages/iotta::numeric END,1) AS ibloat, CASE WHEN ipages < iotta THEN 0 ELSE ipages::bigint - iotta END AS wastedipages, 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 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 + END AS totalwastedbytes FROM ( SELECT nn.nspname AS schemaname, -- cgit v1.2.3