Test sqlite analyze

This commit is contained in:
M66B 2020-11-30 18:22:55 +01:00
parent 493c56bee7
commit 28e1d93514
1 changed files with 7 additions and 1 deletions

View File

@ -305,9 +305,15 @@ public class WorkerCleanup extends Worker {
Log.w("Insufficient space for VACUUM" +
" size=" + Helper.humanReadableByteCount(size) +
"/" + Helper.humanReadableByteCount(available));
}
if (BuildConfig.DEBUG) {
// https://sqlite.org/lang_analyze.html
Log.i("Analyze");
try (Cursor cursor = db.getOpenHelper().getWritableDatabase().query("PRAGMA analysis_limit=1000; PRAGMA optimize;")) {
cursor.moveToNext();
}
}
} catch (Throwable ex) {
Log.e(ex);
} finally {