SQLite Forum

Sqlite high IO load makes usage impossable
Login
So much this. A few years ago I had to refactor some code that was doing this very thing. Every query for a single row was built from scratch, then prepared, stepped, and finalized. A database update could take over 24 hours (update in this case meaning re-writing the database to change the schema between version 1 and version 2 of the application).

When I rewrote it to reuse queries across multiple rows, our migration time went down to 5 to 15 minutes for a 5 or so GB database.

There is a ton of overhead preparing queries. It is to your advantage to create queries that can be prepared once and used over and over again.