From 92c79a7122fdd91993456626b401ff6445b218c1 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Thu, 5 Feb 2026 23:25:07 +0530 Subject: [PATCH] chore: increase cache_size and use memory temp store (#25930) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/infrastructure/repositories/db.repository.dart | 4 +++- .../lib/infrastructure/repositories/logger_db.repository.dart | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/lib/infrastructure/repositories/db.repository.dart b/mobile/lib/infrastructure/repositories/db.repository.dart index 2d30e3a0b9..652e9de943 100644 --- a/mobile/lib/infrastructure/repositories/db.repository.dart +++ b/mobile/lib/infrastructure/repositories/db.repository.dart @@ -228,7 +228,9 @@ class Drift extends $Drift implements IDatabaseRepository { await customStatement('PRAGMA foreign_keys = ON'); await customStatement('PRAGMA synchronous = NORMAL'); await customStatement('PRAGMA journal_mode = WAL'); - await customStatement('PRAGMA busy_timeout = 30000'); + await customStatement('PRAGMA busy_timeout = 30000'); // 30s + await customStatement('PRAGMA cache_size = -32000'); // 32MB + await customStatement('PRAGMA temp_store = MEMORY'); }, ); } diff --git a/mobile/lib/infrastructure/repositories/logger_db.repository.dart b/mobile/lib/infrastructure/repositories/logger_db.repository.dart index 583fc42813..0037f4a1e3 100644 --- a/mobile/lib/infrastructure/repositories/logger_db.repository.dart +++ b/mobile/lib/infrastructure/repositories/logger_db.repository.dart @@ -22,6 +22,7 @@ class DriftLogger extends $DriftLogger implements IDatabaseRepository { await customStatement('PRAGMA synchronous = NORMAL'); await customStatement('PRAGMA journal_mode = WAL'); await customStatement('PRAGMA busy_timeout = 500'); + await customStatement('PRAGMA temp_store = MEMORY'); }, ); }