Currently the package contains the only tool pgcompact
, we are
planning to add much more in the future. Stay tuned.
The list of changes can be found in CHANGES.md. The To-Do List is in TODO.md.
The easiest way to deploy the toolkit is to download the latest
stable version, unpack the archive and copy the autonomous scripts
from the fatpack
directory to your bin
or to just add this
directory to your PATH
. The autonomous scripts are packed with all
the dependencies and need Perl >=5.8.8
to be installed only.
If you need a specific version or branch of the tools, replace the
stable
with its name string in the URL.
Another way is to git clone
the repository
git clone https://github.com/grayhemp/pgtoolkit.git
or to svn checkout
it
svn checkout https://github.com/grayhemp/pgtoolkit
Do not forget to switch to the necessary version branch afterwards.
You can also use the autonomous scripts in the fatpack
directory or
the non-autonomous versions of them in the bin
directory. For the
latter you need the lib
directory either to be in the same
sub-directory with bin
or to be in your PERL5LIB
.
A tool to reduce bloat for tables and indexes without heavy locks and full table rebuilding.
Initially the tool is an automation of the solutions proposed in these publications:
If pgstattuple is installed pgcompact
uses it to get a better
statistics. It is highly recommended to be for TOAST
ed tables and
indexes.
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 --verbosity 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
Perl >=5.8.8
, so it can just be
copied to server and runDBD::Pg
, DBD::PgPP
or even psql
if there are no
former ones, detects and chooses the best option automaticallyCopyright © 2011-2014 Sergey Konoplev, Maxim Boguk
PgToolkit is released under the PostgreSQL License, read LICENSE.md for additional information.
Thank you: