From 4380a374c1dec46ad77939604e548f0c79d9e2ec Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 Dec 2008 14:41:21 +1100 Subject: repack the ldb after re-indexing re-indexing in ldb is triggered on any modification to the @ATTRIBUTES or @INDEXLIST records. This happens to produce a worst-case fragmentation of the database, as all @INDEX records are deleted then re-created. By repacking after re-indexing we ensure that the database ends up without extreme fragmentation. --- source4/lib/ldb/ldb_tdb/ldb_index.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 65711d9f4b..eedbda4170 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1250,5 +1250,9 @@ int ltdb_reindex(struct ldb_module *module) return LDB_ERR_OPERATIONS_ERROR; } + if (tdb_repack(ltdb->tdb) != 0) { + return LDB_ERR_OPERATIONS_ERROR; + } + return LDB_SUCCESS; } -- cgit