SQL B-tree, Composite, and Covering Indexes/Create a single-column index

Index a common lookup column.

Section: Create index patterns

Create a single-column index

sql
sql
CREATE INDEX idx_users_email ON users (email);
Explanation

A classic lookup index for logins, unique checks, or profile fetches.

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 Create index patterns
Create a composite index
Index fields that are commonly used together.
OpenIn sheetsqlsame section
PostgreSQL covering index with INCLUDE
Store extra columns for index-only scans.
OpenIn sheetsqlsame section
Design for equality then range
Put equality columns first in many B-tree cases.
OpenIn sheetsqlsame section
Support ORDER BY with an index
Avoid expensive sorts when possible.
OpenIn sheetsql1 tag match
Example covering query
Query only indexed columns when possible.