Index only matching rows.
Section: SQLite index creation
Partial index
sql
sql
CREATE INDEX idx_tasks_open_due_at ON tasks (due_at) WHERE completed_at IS NULL;Explanation
A smaller index can be more efficient when only open tasks matter to the hot path.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing SQLite index creation