[check_postgres] check_bloat: "no matching relations" error when using --exclude
Marti Raudsepp
marti at juffo.org
Fri Oct 23 09:04:00 UTC 2009
Hi list,
I found a case where check_bloat is flagging false alarms. I have a
database with lots of "smallish" tables, and then 2 partitioned tables
split into many partitions. Since these partitions are quite large and
queried rarely, I don't care about their bloat. (it doesn't help that
warning/critical limits can only be specified in terms of absolute
byte units, not percentages). Thus I'm running check_postgres_bloat
with --exclude to skip those tables.
However, because those are the largest tables, they always get
returned first by the query. Since check_bloat has a default LIMIT of
10 and the --exclude filtering is done after the query in Perl code,
it finds no actual matching tables.
The immediate solution seems to be to ignore LIMIT/--perflimit
entirely when --exclude is set; the --include option is already
handled this way.
In the longer term, --include/--exclude checking should probably be
done in the database query, but my Perl skills are too poor for that.
I'd be happy to write a patch, but seeing that my previous one didn't
even get a comment there's no reason to believe I will do better this
time.
(And speaking of the other patch, can you give some feedback? What am
I doing wrong and how do I get it in a mergeable state?)
Regards,
Marti
More information about the Check_postgres
mailing list