Fix ORDER BY in the last vacuum/analyze action
authorNicolas Thauvin <[email protected]>
Mon, 27 Jun 2011 15:26:47 +0000 (17:26 +0200)
committerGuillaume Lelarge <[email protected]>
Mon, 27 Jun 2011 15:26:47 +0000 (17:26 +0200)
Before this patch, the "ORDER BY" was on the relname column. This fixes it to
get an ORDER BY on the last time column, which is more interesting
(especially when you have a perflimit).

check_postgres.pl

index 0294eecf3be108794d3ff2fcc91f32298ef361a0..0bc1ac2544ddd97ee7b584b32d8d241889ddc747 100755 (executable)
@@ -4414,7 +4414,7 @@ FROM (SELECT nspname, relname, $criteria AS v
       ORDER BY 3) AS foo
 };
     if ($opt{perflimit}) {
-        $SQL .= ' ORDER BY 3 DESC';
+        $SQL .= ' ORDER BY 4 DESC';
     }
 
     if ($USERWHERECLAUSE) {