"Over time, the database files within the datastore can become fragmented" " [the compaction] creates new files, the data is packed more efficiently, helping to alleviate lost disc space caused by fragmentation"
By default, the compaction starts with the largest file in the datastore. However, if the --smallest-first option is used (to perform a reverse compact), then the compaction starts with the smallest file. For more information, see "What about Reverse Compact?" below.
For each files in /usr/tideway/var/tideway.db/data/datadir (for example: p0002_nHost_hist), the compaction: - creates a (compacted) copy of the file in /usr/tideway/var/tideway.db/data/datadir/n00000 - removes the file from datadir
When there are no files left in datadir to compact, the (compacted) files are copied from n00000back to datadir