Skip to content

Conversation

@britiger
Copy link

@britiger britiger commented Jan 28, 2026

General information

This PR fixes a bug in calculation of table bloat in PostgreSQL. As described in the community forum there is a bug. The agent plugin mk_postgres.py returns one table with all bloat values for tables and indexes. If a table has more than one index it also increased the bloat for this table multiple times. In some cases the reported wasted table size is bigger than the table itself.
Also the output of index and tablenames if in state WARN or CRIT are without schema. Within a database the tablename is not unique.

Proposed changes

Change the calculation and output in postgres_bloat:

  • save the name of last added table
  • increase the value of wasted space only if it's a new table
  • Change Output to schema.table which is unique in the database

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@britiger
Copy link
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants