SyntaxStudy
Sign Up
MySQL Advanced 5 min read

Covering Indexes

Covering Indexes

A covering index includes all columns needed by a query, so MySQL can answer it entirely from the index without touching the table data.

Example
-- Query needs status, customer_id, total
-- Create a covering index with all three columns
CREATE INDEX idx_cover ON orders (status, customer_id, total);

-- EXPLAIN shows "Using index" — no table access
SELECT status, customer_id, total
FROM orders
WHERE status = 'shipped' AND customer_id = 10;
Pro Tip

Look for "Using index" in EXPLAIN Extra — that means a covering index hit.