Do not try to optimize when there are too few files, it seems to bring more drawbacks than benefits
This commit is contained in:
@@ -32,8 +32,13 @@ namespace lms::scanner
|
||||
if (context.scanOptions.forceOptimize)
|
||||
return true;
|
||||
|
||||
if (context.stats.nbChanges() > (context.stats.nbFiles() / 10))
|
||||
// Don't optimize if there are too few files: it may lead to some indexes not being used
|
||||
// and will drastically slow down the scan process when adding more files later
|
||||
if (context.stats.getChangesCount() > (context.stats.getTotalFileCount() / 5)
|
||||
&& context.stats.getTotalFileCount() >= 1'000)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user