pgcompact — A tool to reduce bloat for tables and indexes without heavy locks and full table rebuilding.

pgcompact

A tool to reduce bloat for tables and indexes without heavy locks and full table rebuilding.

https://github.com/grayhemp/pgtoolkit

Features

  • Requires no dependencies except Perl >=5.8.8, so it can just be copied to server and run
  • Works with DBD::Pg, DBD::PgPP or even using psql if there are no former ones, detects and chooses the best option automatically
  • Can process specified tables, schemes, databases or the whole cluster
  • Has an ability to exclude tables, schemes or databases from processing
  • Bloat percentage analysis and processing of those tables that need it only, we recommend to install pgstattuple for more precise estimations
  • Indexes bloat analysis and non blocking reindex of those that need it
  • Analysis and rebuilding of bloated unique constraints and primary keys where possible
  • Incremental processing, in other words one can stop the process and continue it at any time later
  • Dynamic adjustment to current load of database to not affect its performance
  • Instructs administrators, supplying them with ready to use DDL, to manually rebuild database objects that can not be rebuilt automatically

Leave a Reply