Composite Index


A composite index is an index created on multiple columns.

It improves performance for queries that filter by more than one column.

Composite indexes follow column order strictly.

The leftmost column is the most important.

Query must match index order.

Composite indexes are useful in WHERE clauses with multiple conditions.

They reduce query execution time.

A composite index can be created on user_id and status together.

This improves combined filtering.

Composite indexes must be planned carefully.

Wrong column order reduces usefulness.

Proper design improves performance greatly.