You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor some code around, add comments and introduce a dedicated db
checkpointing thread with background priority to not block write
transactions longer than strictly needed.
//some settings (e.g. truncate is faster than delete)
105
131
//this uses the private api because we have no thread local instance added to the threadData dictionary yet and we don't use a transaction either (and public apis check both)
106
132
//--> we must use the internal api because it does not call testThreadInstanceForQuery: testTransactionsForQuery:
107
-
sqlite3_busy_timeout(self->_database, 2000); //set the busy time as early as possible to make sure the pragma states don't trigger a retry too often
133
+
sqlite3_busy_timeout(self->_database, 1000); //set the busy time as early as possible to make sure the pragma states don't trigger a retry too often
134
+
135
+
//set wal mode (this setting is permanent): https://www.sqlite.org/pragma.html#pragma_journal_mode
136
+
//this is a special case because it can not be done while in a transaction!!!
137
+
[selfenableWAL];
138
+
139
+
//some settings for faster sqlite, see https://hg.prosody.im/trunk/file/df32fff0963d/plugins/mod_storage_sql.lua#l943
140
+
//synchronous NORMALE versus OFF don't have any differences in WAL mode, see: https://sqlite.org/pragma.html#pragma_synchronous
0 commit comments