Re:Getting the Most Out of Sqlite3 with Python
by Scaevolus on Sunday October 22, 2017 @11:22AM
(#15527181)
Entirely disabling synchronous is incredibly dangerous. Use "pragma journal_mode=wal" for a safe performance boost.
[ Parent
| on HN ]
Re:Getting the Most Out of Sqlite3 with Python
by brianwawok on Sunday October 22, 2017 @11:48AM
(#15527295)
If 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.
Re:Getting the Most Out of Sqlite3 with Python
by SQLite on Sunday October 22, 2017 @05:35PM
(#15529083)
I'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.
Re:Getting the Most Out of Sqlite3 with Python
by mythrwy on Sunday October 22, 2017 @11:55AM
(#15527328)
Disabling 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).
That being said 'journal_mode=wal' is a bit faster than normal async but nowhere even close to the speed of disabling async completely.
Re:Getting the Most Out of Sqlite3 with Python
by justinclift on Monday October 23, 2017 @03:56PM
(#15536428)
> ... don't know where it could be used practically.
Maybe with read only databases?
Re:Getting the Most Out of Sqlite3 with Python
by mythrwy on Tuesday October 24, 2017 @03:12PM
(#15544360)
Would 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.
Re:Getting the Most Out of Sqlite3 with Python
by justinclift on Friday October 27, 2017 @05:19PM
(#15572314)
Hmmm, I'm not sure either. If you got around to testing it, it'd be interesting to hear about. :)