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.

Level: advancedTopic: SQL databases

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.