From a32fe222ebbe1885fa5ed6acc3ff948cf1085705 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 4 Sep 2021 20:02:38 +0200 Subject: [PATCH] Increase sqlite cache size to 5M --- app/src/main/java/eu/faircode/email/DB.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index bbad2dbe8c..abd8f96d77 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -400,15 +400,13 @@ public abstract class DB extends RoomDatabase { Log.i("Get PRAGMA " + pragma + "=" + (cursor.moveToNext() ? cursor.getString(0) : "?")); } - if (BuildConfig.DEBUG) { - Log.i("Set PRAGMA cache_size=" + DB_CACHE_SIZE); - try (Cursor cursor = db.query("PRAGMA cache_size=" + DB_CACHE_SIZE + ";", null)) { - cursor.moveToNext(); // required - } + Log.i("Set PRAGMA cache_size=" + DB_CACHE_SIZE); + try (Cursor cursor = db.query("PRAGMA cache_size=" + DB_CACHE_SIZE + ";", null)) { + cursor.moveToNext(); // required + } - try (Cursor cursor = db.query("PRAGMA cache_size;")) { - Log.i("Get PRAGMA cache_size=" + (cursor.moveToNext() ? cursor.getInt(0) : "?")); - } + try (Cursor cursor = db.query("PRAGMA cache_size;")) { + Log.i("Get PRAGMA cache_size=" + (cursor.moveToNext() ? cursor.getInt(0) : "?")); } if (BuildConfig.DEBUG && false) {