We will see some examples of Cardinality later in this guide.
Also given the nature of a binary search, the Cardinality or uniqueness of the data is important.
The Cardinality of the set“S” is“5” which is the total number of elements contained inside a set.
The Cardinality of a set is also called its size, when no confusion
with other notions of size is possible.
For example, the set A{ 2, 4, 6}{\displaystyle A=\{2,4,6\}} contains 3 elements, and therefore A{\displaystyle A}
has a Cardinality of 3.
Indexing on a field with a Cardinality of 2 would split the data in half,
whereas a Cardinality of 1,000 would return approximately 1,000 records.
With such a low Cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the Cardinality is less than 30% of
the record number, effectively making the index a waste of space.
With such a low Cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the Cardinality is greater than 30% of
the record number, effectively making the index a waste of space.