&product; Developer Andi Clemens andi dot clemens at gmx dot net
&product;
1
&product;
&product;
&version;

# &product;

Cleanup the &digikam; databases to reduce their sizes and increase access speed

                &product;
                -t
                -T
                -p
                -h

## Options

`-t`

  Include thumbnail databases.

`-T`

  Only cleanup thumbnail databases.

`-p `path``

  Specify a different database path. If the specified path is invalid, the entry from the configuration file will be used.

`-h`

  Show command line options.

## Description

&product; will cleanup and optimize the &digikam; database file. This will, in most cases, lead to a smaller database file size and an increased access speed, because unneeded elements are removed from the database and data is optimized.

The program will make sure that no instance of &digikam; is running, because it is more safe to have no database access during the optimization process. It then will read the &digikam; configuration file and determine the database location. In a final step the database will be optimized by invoking the sqlite command '&vacuum;;' on it. If more then one database is found in this location, &product; will optimize every database found in this path and below.

For further explanation, see the following description of the &vacuum; command from the sqlite3 website:

When an object (table, index, or trigger) is dropped from the database, it leaves behind empty space. This empty space will be reused the next time new information is added to the database. But in the meantime, the database file might be larger than strictly necessary. Also, frequent inserts, updates, and deletes can cause the information in the database to become fragmented - scrattered out all across the database file rather than clustered together in one place.

The &vacuum; command cleans the main database by copying its contents to a temporary database file and reloading the original database file from the copy. This eliminates free pages, aligns table data to be contiguous, and otherwise cleans up the database file structure.

## Author

&product; was written by Andi Clemens <andi dot clemens at gmx dot net>