static const char sqlite_wal[] = "PRAGMA journal_mode=\"wal\";",
fallback_journal[] = "PRAGMA journal_mode=\"off\";",
foreign_keys[] = "PRAGMA foreign_keys=\"ON\";",
- secure_delete[] = "PRAGMA secure_delete=\"OFF\";";
+ secure_delete[] = "PRAGMA secure_delete=\"OFF\";",
+ enable_mmap[] = "PRAGMA mmap_size=268435456;";
gint rc;
if (path == NULL) {
sqlite3_errmsg (backend->db));
}
+ if (sizeof (gpointer) >= 8 &&
+ (rc = sqlite3_exec (backend->db, enable_mmap, NULL, NULL, NULL)) !=
+ SQLITE_OK) {
+ msg_warn_fuzzy_backend ("cannot enable mmap: %s",
+ sqlite3_errmsg (backend->db));
+ }
+
rspamd_fuzzy_backend_run_simple (RSPAMD_FUZZY_BACKEND_VACUUM, backend, NULL);
if (rspamd_fuzzy_backend_run_stmt (backend, RSPAMD_FUZZY_BACKEND_COUNT)
static const char sqlite_wal[] = "PRAGMA journal_mode=\"wal\";",
exclusive_lock_sql[] = "PRAGMA locking_mode=\"exclusive\";",
fsync_sql[] = "PRAGMA synchronous=1;",
- foreign_keys[] = "PRAGMA foreign_keys=\"ON\";";
+ foreign_keys[] = "PRAGMA foreign_keys=\"ON\";",
+ enable_mmap[] = "PRAGMA mmap_size=268435456;";
gboolean create = FALSE, has_lock = FALSE;
flags = SQLITE_OPEN_READWRITE;
sqlite3_errmsg (sqlite));
}
+ if (sizeof (gpointer) >= 8 &&
+ (rc = sqlite3_exec (sqlite, enable_mmap, NULL, NULL, NULL)) !=
+ SQLITE_OK) {
+ msg_warn_pool ("cannot enable mmap: %s",
+ sqlite3_errmsg (sqlite));
+ }
+
if (has_lock) {
msg_debug_pool ("removing lock from %s", lock_path);
rspamd_file_unlock (lock_fd, FALSE);