Y
Hacker News
new
|
ask
|
show
|
jobs
by
mappu
3657 days ago
I've found sqlite's performance on bulk insertions to be massively (100x) improved by wrapping the bulk insertion in a transaction.
fsync()ing a couple hundred thousand individual INSERTs isn't fast.
3 comments
coleifer
3657 days ago
Batching inserts, wrapping the batches in transactions, waiting til after to add indexes: best way to go.
link
Sami_Lehtinen
3657 days ago
Journaling mode and sync modes etc, also make a big difference:
http://www.sami-lehtinen.net/blog/sqlite3-performance-testin...
link
lomnakkus
3656 days ago
Those optimizations also apply to PostgreSQL.
link
Programmatic
3656 days ago
It would still allow you to use a simpler solution and not paint yourself in a corner if you optimized on sqlite; no preemptive optimization necessary wrt choice of dbms if you can perform the work on the simpler solution.
link
lomnakkus
3655 days ago
Optimizing in SQLite is just as much of a sunk cost as optimizing in PostgreSQL if you switch away to another database.
link