Welcome to the pg_reorg Project Home Page

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.



Execution time

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
 id bigserial,
 rndkey bigint NOT NULL,
 dummy1 bigint NOT NULL,
 dummy2 bigint NOT NULL,
 dummy3 bigint NOT NULL,
 dummy4 bigint NOT NULL,
 dummy5 bigint NOT NULL,
 dummy6 bigint NOT NULL,
 dummy7 bigint NOT NULL,
 dummy8 timestamp NOT NULL,
 dummy9 timestamp NOT NULL,
 dummy10 timestamp NOT NULL,
 dummy11 timestamp NOT NULL,
 dummy12 timestamp NOT NULL,
 dummy13 timestamp NOT NULL,
 dummy14 timestamp NOT NULL,
 filler char(128) NOT NULL

CREATE INDEX test_idx_rndkey ON test (rndkey);
ALTER TABLE test CLUSTER ON test_idx_rndkey;