Keep the hot subset small and efficient.

Section: Pattern catalog

Index only open items

sql
sql
CREATE INDEX idx_tickets_open_priority_created_at
ON tickets (priority, created_at DESC)
WHERE closed_at IS NULL;
Explanation

Great for dashboards or queues that mostly show open work items.

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
SQLite partial index for active rows
Shrink the index to the rows that matter most.
OpenIn sheetsqlsame section
PostgreSQL case-insensitive email lookup
Index the normalized expression you actually query.
OpenIn sheetsqlsame section
MySQL generated column from JSON
Make a JSON path searchable with an index.
OpenIn sheetsqlsame section