What exactly happens during the database optimization phase of scanning?

It does run a "vacuum" on the database:
https://sqlite.org/lang_vacuum.html

Does "Database Optimize" have to be performed at every scan?  Would

No. It's an optimization, not a requirement.

there be a way to limit the database optimize phase to just once per day
and / or only after multiple albums (e.g. >20) have been added?

Most people don't run scans multiple times per day and just don't care. Or it doesn't take that long as for you (11s for me, 21k tracks, oldish Intel Atom 330).

But feel free to add a few lines or disable the step in SQLiteHelper.pm:

https://github.com/Logitech/slimserver/blob/public/7.9/Slim/Utils/SQLiteHelper.pm#L318

If you look at sub vacuum, you'd see that it would accept an "optional" parameter:

https://github.com/Logitech/slimserver/blob/public/7.9/Slim/Utils/SQLiteHelper.pm#L509

By setting this the vacuum would only be run if there was a certain level of fragmentation. Setting that second parameter in the call to ->vacuum() around line 320 might be all you need to do.

--

Michael
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta

Reply via email to