Pruning and Cleaning the Database
Purpose: You wish to reduce the size of your OpenIZ instance by removing obsolete versions of data from the data store and/or increase performance of the database.
Introduction: OpenIZ's database provides a versioned history of all edits made to concepts, acts, and entities. While this function is useful for tracing the lifetime of an object, it can cause additional data usage on your server. It is a good practice to occasionally check on the database to ensure it is running at peak performance. This help and support article will show you how to use some basic commands to clean up and prune your OpenIZ database.
Applies To:
OpenIZ Immunization Management Server (running PostgreSQL database)
Steps:
Connect to your PostgreSQL instance using psql or PgAdmin.
Get the time that tables were last vacuumed & analyzed
If you notice that last_analyze has not occurred run the ANALYZE command
If you notice that last_vacuum has not occurred in a long time run VACUUM FULL command
If you notice that last_autovacuum has not occurred in a long time, ensure that your configuration is correct and auto-vacuum is setup by running SHOW ALL
Get the size of the database per patient:
If the database size seems large for your patient population (about 50 kb per patient) you may want to reduce size by squashing the database. (NOTE: Only base your decision on the size reported after running VACUUM FULL)
SQUASHING: - Just as in GIT the act of squashing the database results in removing all the version history for patients and acts such that only the current version is kept. To squash the database:
!!WARNING!!: Ensure that you take a backup of your database before squashing it.
The database server should report its progress:
Last updated