metadata: Create compact LMDB snapshots

See #1006

LMDB files never shrink, so we can end up with a large database that
contains a smaller amount of actual data.

Compacting the snapshots is an easy win: it will write faster to disk,
take less space, and if needed you can reimport an already-compacted
snapshot as the main database.
This commit is contained in:
Baptiste Jonglez
2025-04-12 23:18:50 +02:00
parent 14d2f2b18d
commit 9ec3f8cc3c
+1 -1
View File
@@ -109,7 +109,7 @@ impl IDb for LmdbDb {
let mut path = to.clone();
path.push("data.mdb");
self.db
.copy_to_path(path, heed::CompactionOption::Disabled)?;
.copy_to_path(path, heed::CompactionOption::Enabled)?;
Ok(())
}