Shrink the index to the rows that matter most.
Section: Pattern catalog
SQLite partial index for active rows
sql
sql
CREATE INDEX idx_subscriptions_active_renewal_date
ON subscriptions (renewal_date)
WHERE canceled_at IS NULL;Explanation
This is especially attractive in lightweight local databases where space matters.
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 Pattern catalog
PostgreSQL case-insensitive email lookup
Index the normalized expression you actually query.
MySQL generated column from JSON
Make a JSON path searchable with an index.