Cardinality in Database

Senthil Nayagan
1 min readOct 27, 2018

--

Photo by Eloise Ambursley on Unsplash

Overview

In the context of databases, cardinality refers to the uniqueness of data values contained in a particular column. It also sometimes refers to the relationships between tables — cardinality between tables can be one-to-one, many-to-one or many-to-many.

Note that cardinality impacts performance a lot, because it influences the query execution plan.

Higher Cardinality

High cardinality means that the column contains a large percentage of totally unique values. High cardinality column values are typically identification numbers, email addresses, etc.

Low Cardinality

Low cardinality means that the column contains a lot of “repeats” in its data range. Low cardinality column values are typically status flags, Boolean values, etc.

--

--

Senthil Nayagan
Senthil Nayagan

Written by Senthil Nayagan

I am a Data Engineer by profession, a Rustacean by interest, and an avid Content Creator.

Responses (1)