5 ms·
Entirely disabling synchronous is incredibly dangerous. Use "pragma journal_mode=wal" for a safe performance boost.
by Scaevolus 9y ago
Entirely disabling synchronous is incredibly dangerous. Use "pragma journal_mode=wal" for a safe performance boost.
- brianwawok 9y agoIf your program is load 100gb of data, query, then destroy the db... you don't care if a crash loses data. You just run again.
- mythrwy 9y agoDisabling synchronous is dangerous and I don't know where it could be used practically (if you care about your data https://www.sqlite.org/howtocorrupt.html#_failure_to_sync https://www.sqlite.org/howtocorrupt.html#_failure_to_sync). That being said 'journal_mode=wal' is a bit faster than normal async but nowhere even close to the speed of disabling async completely.
- justinclift 9y ago> ... don't know where it could be used practically. Maybe with read only databases?
- mythrwy 9y agoWould you get a speed increase in reads? I thought async and wal speedup would just be for writes (no good for read only database). Maybe I'm misinformed. Have to play with it and see.
- justinclift 9y agoHmmm, I'm not sure either. If you got around to testing it, it'd be interesting to hear about. :)
- SQLite 9y agoI'm not sure synchronous=off qualifies as incredibly dangerous. You can corrupt the database with synchronous=off, but only if you loss power or take an OS reboot in the middle of a transaction. Even with synchronous=off, transactions are still ACID and the database is guaranteed to be intact following an application crash. It takes an OS crash or power failure to cause problems.