Do you know any good default PRAGMAs that one should enable?
PRAGMA foreign_keys=ON
PRAGMA recursive_triggers=ON
PRAGMA journal_mode=WAL
PRAGMA busy_timeout=30000
PRAGMA synchronous=NORMAL
PRAGMA cache_size=10000
PRAGMA temp_store=MEMORY
PRAGMA wal_autocheckpoint=1000
PRAGMA optimize <- run on tx start
Note that I do not use auto_vacuum for DELETEs are uncommon in my workflows and I am fine with the trade-off and if I do need it I can always PRAGMA it.defer_foreign_keys is useful if you understand the pros and cons of enabling it.
for example? I'm surprised by the downvotes. Using mmap significantly reduced my average read query time; durations about 70% the length!
Except for long lived connections where you do it periodically.
https://www.sqlite.org/lang_analyze.html#periodically_run_pr...
In any case, there is no harm in setting sticky pragmas every connection.
https://sqlite.org/compile.html#recommended_compile_time_opt...