Part 2 of 5 · 1 min read
Sargable predicates
A condition is sargable when the database can use an index to evaluate it directly.
Think of two phone book searches. "Find every name starting with Sm" is directly supported by the alphabetical order; "find every name whose letters add up to a certain number" gets no help from that ordering at all.
In plain words: a predicate, which is simply a condition in a WHERE clause, is called sargable, short for "search argument able," when the database can evaluate it directly using an index's sorted structure, without having to compute something for every single row first. A condition such as customer_id = 42 or placed_on >= '2026-01-01' is sargable, since the index's own sort order directly supports finding matches. The next section covers the most common way a condition stops being sargable, even when an index exists.
A worked example. WHERE placed_on >= '2026-01-01' is sargable against an index on placed_on, since the index's sorted order lets the database jump directly to the starting point and read forward.
The key lines.
SELECT * FROM orders WHERE placed_on >= '2026-01-01';
-- sargable: the index on placed_on can be used directly
Sargable predicate
A sargable predicate is a condition the database can evaluate directly using an index's structure, without computing something for every row first.
Example: "find every name starting with Sm" directly uses a phone book's alphabetical order, the same way a sargable predicate directly uses an index's sorted order.