Optimize database during scan to ease very large DB imports

This commit is contained in:
emeric
2023-11-02 14:55:27 +01:00
parent 1be04b6e76
commit e0ed182784
3 changed files with 15 additions and 0 deletions
@@ -307,6 +307,10 @@ namespace Scanner
context.currentStepStats.processedElems++;
_progressCallback(context.currentStepStats);
// optimize the database during scan (if we import a very large database, it may be too late to do it once at end)
if ((context.stats.nbChanges() % 5'000) == 0)
_db.getTLSSession().optimize();
}
return true;