Subtleties of SQLite Indexes
emschwartz.me·13w·
Preview
Report Post
  • Sep 29, 2025*

In the last 6 months, Scour has gone from ingesting 330,000 pieces of content per month to over 1.4 million this month. The massive increase in the number of items slowed down the ranking for users’ feeds and sent me looking for ways to speed it up again.

After spending too many hours trying in vain to squeeze more performance out of my queries and indexes, I dug into how SQLite’s query planner uses indexes, learned some of the subtleties that explained why my initial tweaks weren’t working, and sped up one of my main queries by ~35%.

Scour’s items table

Scour is a personalized content feed that finds articles, blog posts, etc related to users’ interests. For better and for worse, Scour does its ranking on the fly whenever users load their…

Similar Posts

Loading similar posts...