jargon

Backend & systems·Data modelling and storage engines

you index the boolean column, the planner ignores it, and the reason is that half the table matches any value you look up.

Cardinality

Also calledselectivity, distinct values

How many distinct values a column holds, and by extension how much an index on it narrows the search. High-cardinality columns make good indexes; low-cardinality ones usually do not, because reading the index plus random rows costs more than a scan. This is why the planner declines indexes you were sure would help.

Commonly confused with