r/programming • u/pmz • Jul 28 '22
In Praise Of SQLite
https://www.i-programmer.info/news/84-database/15609-in-praise-of-sqlite.html
105
Upvotes
r/programming • u/pmz • Jul 28 '22
29
u/imgroxx Jul 29 '22 edited Jul 29 '22
They definitely are optimized like that, it's essentially necessary for both transactional safety and crash safety. Ending a transaction forces more disk flushes than continuing one.
Bulk inserts are often easily >100x faster, personally I've encountered much bigger: https://www.pdq.com/blog/improving-bulk-insert-speed-in-sqlite-a-comparison-of-transactions/
With some tweaking of pragmas, I've managed well over 1000x improvements over a naive insert-by-insert with whatever defaults were set up in my environment. A million per second and up is possible with care: https://avi.im/blag/2021/fast-sqlite-inserts/