8471 shaares
203 private links
203 private links
Moral of the story: only use SQLite for websites where updates to the database happen rarely (less often than every page loaded).
Think about indexes:
As I mentioned in my first edit, database indexes dramatically reduce query time, but this is more of a general observation about databases than it is about SQLite.
And transactions to speed up writes:
However, there is another trick you can use to speed up SQLite: transactions. Whenever you have to do multiple database writes, put them inside a transaction. Instead of writing to (and locking) the file each and every time a write query is issued, the write will only happen once when the transaction completes.