This tools re-organize tables on a PostgreSQL database without keeping any locks so that you can retrieve or update rows.
Now, the development and maintenounce of pg_reorg has been stopped. The laste stable branch maint_1.1 supported PostgreSQL version, 8.4 to 9.4.
Now,we join to pg_repack project. Please use it instead of pg_reorg.
pg_reorg run for a specified table like below:
$ pg_reorg -t test1 -o a
INFO: ---- reorganize one table with 7 steps. ----
INFO: target table name : test1
INFO: ---- STEP1. setup ----
INFO: This needs EXCLUSIVE LOCK against the target table.
INFO: ---- STEP2. copy tuples into temp table----
INFO: ---- STEP3. create indexes ----
INFO: ---- STEP4. apply logs ----
INFO: ---- STEP5. swap tables ----
INFO: This needs EXCLUSIVE LOCK against the target table.
INFO: ---- STEP6. drop old table----
INFO: ---- STEP7. analyze ---
See documentation about detail usage.
http://ossc-db.github.io/pg_reorg/index.html
Change directory into top directory of pg_reorg sorce codes and run the below commands.
$ make
# make install
Start PostgreSQL server and run the below command.
$ make installcheck