Disable sqlite cache spill

This commit is contained in:
M66B 2021-09-04 20:06:56 +02:00
parent a32fe222eb
commit ecd07306ae
1 changed files with 10 additions and 1 deletions

View File

@ -395,7 +395,7 @@ public abstract class DB extends RoomDatabase {
"synchronous", "journal_mode",
"wal_checkpoint", "wal_autocheckpoint",
"page_count", "page_size",
"cache_size"})
"cache_size", "cache_spill"})
try (Cursor cursor = db.query("PRAGMA " + pragma + ";")) {
Log.i("Get PRAGMA " + pragma + "=" + (cursor.moveToNext() ? cursor.getString(0) : "?"));
}
@ -409,6 +409,15 @@ public abstract class DB extends RoomDatabase {
Log.i("Get PRAGMA cache_size=" + (cursor.moveToNext() ? cursor.getInt(0) : "?"));
}
Log.i("Set PRAGMA cache_spill=0");
try (Cursor cursor = db.query("PRAGMA cache_spill=0;", null)) {
cursor.moveToNext(); // required
}
try (Cursor cursor = db.query("PRAGMA cache_spill;")) {
Log.i("Get PRAGMA cache_spill=" + (cursor.moveToNext() ? cursor.getInt(0) : "?"));
}
if (BuildConfig.DEBUG && false) {
db.execSQL("DROP TRIGGER IF EXISTS `attachment_insert`");
db.execSQL("DROP TRIGGER IF EXISTS `attachment_delete`");