Learning a few things about running SQLite(jvns.ca)
267 points by surprisetalk 18 hours ago | 69 comments
tl;dr: A developer running a Django site on SQLite shares lessons learned: running ANALYZE dramatically sped up a slow FTS5 query (from 5s to 0.05s) by giving the query planner better statistics. They also hit issues with SQLite's single-writer limitation during bulk deletes causing worker timeouts and crashes, which they work around with small batches. For backups, they've used both restic (with VACUUM INTO) and Litestream for incremental replication to S3.
HN Discussion:
  • Sharing helpful SQLite tools and tips that complement the author's learnings
  • Criticizing the article for lacking rigor, guessing instead of investigating
  • Offering concrete solutions to the DELETE and backup problems the author faced
  • Appreciating the author's authentic exploratory writing style, especially in the LLM era
  • ~Puzzled that such small tables caused problems, suggesting basic indexing would solve it