diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 00527e7fe..65a93a461 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -115,6 +115,11 @@ def init(db_path): raise SqliteError("Failed to open sqlite database at {}: {}" .format(db_path, error.text()), error) + # Enable write-ahead-logging and reduce disk write frequency + # see https://sqlite.org/pragma.html and issues #2930 and #3507 + Query("PRAGMA journal_mode=WAL").run() + Query("PRAGMA synchronous=NORMAL").run() + def close(): """Close the SQL connection."""