Query only indexed columns when possible.

Section: Covering and ordering

Example covering query

sql
sql
SELECT status, created_at, total_amount
FROM orders
WHERE status = 'paid'
ORDER BY created_at DESC
LIMIT 50;
Explanation

Covering or index-only strategies are strongest when the query reads only columns present in the index.

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