TLDR Web Dev · MISCELLANEOUS
SUBTLETIES OF SQLITE INDEXES
Summary from the TLDR Web Dev newsletter
This dev improved the performance of SQLite queries for his custom content feed by understanding how SQLite's query planner uses indexes. Composite indexes are better than multiple single-column indexes, and the order of columns in an index matters, following the "Left to right, no skipping, stops at the first range" rule. Also, the conditions in WHERE clauses for partial indexes must exactly match the corresponding query conditions.