Set the cache_size on persist.db, too.
Optimize scanning of new tracks

Create temporary table of onDiksOnly tracks, instead of querying the
main tracks table over and over again.
Optimize mergeSingleVAAlbum

Don't run the full evaluation if the compilation flag is set already,
and the call only wants to know whether an album is a compilation or
not. No need to double-check whether it really is a compilation.

Re-arrange the WHERE condition to make better use of indices.
The variousArtistsObject doesn't change during an external scan. Create it once and cache its ID, as we access it very often.

Change-Id: I5e12969c110d1a19dc02f95eb39cc56e979847c4
Don't evaluate the inDBOnlyCount and changedOnlyCount when running a wipe & rescan. These would always return 0.

Wipe scanned_files table between scan steps, as we don't want the overhead of the previous scan when there are multiple folders to be scanned (eg. files & playlists)

Change-Id: Ib8bb92d0fe8bdb9d98027521e4dbe40265c9ae19
Tweak artwork scanner: disable autocommit, use prepared SQL statements

Change-Id: If5419a3ca47f2c4c995220c07a17550a96912600
The scanner calls _validTrackOrURL twice for every track. Keep track of
the previous result to skip one processing.
Use readdir in list mode instead of scalar mode - should use less memory on larger folders.

Change-Id: I2628b3ab327853d27bc3994e5aacea3c1f9bea19
use dbh->prepare_cached instead of dbh->do for repeated query.
Cache cleaned tags so we don't need to process every track of an album.
Optimize ignoreCaseArticle: The scanner often does a call using
transliteration first, then without second. Cache both values when we
create them anyway to save one pass in the scanner.