-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When running --action bloat, indexes names are not fully qualified so…
… it's hard, or imposible to know which index is bloated if there are indexes with the same name in different schemas. Here we add the schema to the bloat message when finding bloat in indexes.
- Loading branch information
1 parent
099a599
commit d039829
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ package check_postgres; | |
'backends-oknone' => q{No connections}, | ||
'backends-po' => q{sorry, too many clients already}, | ||
'backends-users' => q{$1 for number of users must be a number or percentage}, | ||
'bloat-index' => q{(db $1) index $2 rows:$3 pages:$4 shouldbe:$5 ($6X) wasted bytes:$7 ($8)}, | ||
'bloat-index' => q{(db $1) index $2.$3 rows:$4 pages:$5 shouldbe:$6 ($7X) wasted bytes:$8 ($9)}, | ||
'bloat-nomin' => q{no relations meet the minimum bloat criteria}, | ||
'bloat-table' => q{(db $1) table $2.$3 rows:$4 pages:$5 shouldbe:$6 ($7X) wasted size:$8 ($9)}, | ||
'bug-report' => q{Please report these details to [email protected]:}, | ||
|
@@ -3755,14 +3755,14 @@ sub check_bloat { | |
|
||
## Now the index, if it exists | ||
if ($index ne '?') { | ||
my $nicename = perfname($index); | ||
my $nicename = perfname("$schema.$index"); | ||
$perf{$iwb}{$nicename}++; | ||
my $msg = msg('bloat-index', $dbname, $index, $irows, $ipages, $iotta, $ibloat, $iwb, $iws); | ||
my $msg = msg('bloat-index', $dbname, $schema, $index, $irows, $ipages, $iotta, $ibloat, $iwb, $iws); | ||
my $ok = 1; | ||
my $iperbloat = $ibloat * 100; | ||
|
||
if ($MRTG) { | ||
$stats{index}{"DB=$dbname INDEX=$index"} = [$iwb, $ibloat]; | ||
$stats{index}{"DB=$dbname INDEX=$schema.$index"} = [$iwb, $ibloat]; | ||
next; | ||
} | ||
if ($critical->($iwb, $iperbloat)) { | ||
|