Database Cleanup
The Database Cleanup action can result in reduced database size and better database performance. The following are some scenarios where this action could be used:
When a large amount of data is deleted from the database file it leaves behind empty space. This means the database file might be larger than necessary. Running the Database Cleanup action reclaims this space and reduces the size of the database file.
Frequent inserts, updates, and deletes can cause the database file to become fragmented, where data for a single table or index is scattered around the database file. Running the Database Cleanup action ensures that each table and index is stored continuously within the database file. Having indexes in order improves performance.
Note
The Database Cleanup action works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. When overwriting the original, a rollback journal or write-ahead log WAL file is used just as it would be for any other database transaction. This means that when performing a Database Cleanup action on a database, as much as twice the size of the original database file is required in free disk space.
Note
The Database Cleanup action will fail if there is an open transaction, or if there are one or more active SQL statements when it is run.
Before performing an export of a project the project size could be shrunk. This is done by first using the Clear Datalogger action, and then the Database Cleanup action.
If an unusually big amount of database transactions has been performed, a Database Cleanup could help boost database performance.