Hi all,
I am pleased to announce the first stable release of PgToolkit
https://github.com/grayhemp/pgtoolkit.
# PgToolkit - tools for PostgreSQL maintenance
Currently the package contains the only tool `pgcompact`, we are
planning to add much more in the future. Stay tuned.
## pgcompact
A tool to reduce bloat for tables and indexes without heavy locks and
full table rebuilding.
If [pgstattuple] is installed `pgcompact` uses it to get a better
statistics. It is highly recommended to be for TOASTed tables and
indexes.
### Usage examples
Shows user manual.
pgcompact --man
Compacts all the bloated tables in all the databases in the cluster
plus their bloated indexes. Prints additional progress information.
pgcompact --all --reindex --verbose info
Compacts all the bloated tables in the billing database and their
bloated indexes excepts ones that are in the `pgq` schema.
pgcompact --dbname billing --exclude-schema pgq --reindex
### 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 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 which can not be rebuilt
automatically.
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com