Conceptual
Login

Composite Index Column Order

A multi-column B-tree index sorts by the first column, then the second within it, so it serves equality on a leading prefix plus at most one trailing range; a predicate on only a non-leading column cannot seek. Rule of thumb: equality columns first, then the range or ORDER BY column.

This Concept is waiting for its first lesson!

A multi-column B-tree index sorts by the first column, then the second within it, so it serves equality on a leading prefix plus at most one trailing range; a predicate on only a non-leading column cannot seek. Rule of thumb: equality columns first, then the range or ORDER BY column.

Are you a teacher? Sign in to start contributing.

Sign In