AI engineering glossary · SQL databases
What is selectivity?
Selectivity: The fraction of a table's rows that a condition matches. A highly selective condition matches few rows, so an index helps a lot; a low-selectivity one matches many, and a scan may be cheaper.
Selectivity: an example
A filter on a unique PAN-like id matches one row in a million and is highly selective, while gender = 'F' matches about half.
Related terms
More SQL databases terms
Where you learn it
Selectivity is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.