This project provides two tools for PostgreSQL; pg_reorg and pg_batch.
pg_reorg can re-organize tables on a postgres database without any locks so that you can retrieve or update rows in tables being reorganized. The module is developed to be a better alternative of CLUSTER and VACUUM FULL.
pg_batch is a SQL job executor program for PostgreSQL. It generates job list from an external SQL script file, and execute the jobs in serial or parallel. It can be used as "a better vacuumdb" with the attached script to run VACUUM.
The pg_reorg project is a PostgreSQL Community project that is a part of the pgFoundry.
The pgFoundry page for the project is at http://pgfoundry.org/projects/reorg, where you can find downloads, documentation, bug reports, mailing lists, and a whole lot more.
Here shows the result of pg_reorg performance test. We have compared between non-fragmented table and fragmented table. Both tables have the same number of records, but fragmented table is bloated by UPDATEs.
Category | Item | Details |
---|---|---|
Hardware | CPU | Xeon E5645 2.4GHz (12 core) * 2 |
Memory | 32GB | |
Storage | SAS 10,000rpm 2TB * 4 | |
Software | OS | RHEL 6.2 (64bit) |
DB | PostgreSQL 9.3.4 | |
pg_reorg | 1.1.10 | |
Data | Scheme |
|