Add an index for a frequently filtered column.
Section: indexes
Create a simple index
sql
sql
CREATE INDEX idx_orders_created_at ON orders (created_at);Explanation
Useful for range scans, sorting, and recent-record lookups.
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 indexes