feat(cli): implement F004 and F005 bloat estimation checks

Closes #125 (closed)

Summary

Implement heap and index bloat estimation for express mode checkup.

New Checks

F004 - Autovacuum: heap bloat estimate

  • Estimates table bloat using pg_stats column statistics
  • Returns top 100 tables by bloat size (>= 1 MiB)
  • Shows real size, extra size, bloat percentage, fillfactor

F005 - Autovacuum: index bloat estimate

  • Estimates B-tree index bloat using pg_stats
  • Returns top 100 indexes by bloat size (>= 1 MiB)
  • Shows real size, table size, bloat percentage, fillfactor

Implementation Notes

  • Uses standard pg_stats view (no special extensions required)
  • Based on well-known bloat estimation algorithms
  • Excludes system schemas (pg_catalog, information_schema, pg_toast)
  • Minimum size threshold of 1 MiB to focus on meaningful bloat

Test plan

  • Tests pass
  • Help shows F004 and F005

🤖 Generated with Claude Code

Edited by Dementii Priadko

Merge request reports

Loading