What is cardinality in cassandra ? How do you define cardinality in cassandra ?
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
In mathematics, cardinality is the number of elements in a set or a group.
In databases, cardinality is an attribute of the uniqueness of data in a column or field.
A column which has high cardinality means that the range of values are mostly unique. An example is a column containing email addresses. It has a high cardinality since only 1 person can have each email address.
A column which has low cardinality means that it contains values that appear repeatedly. An example is a boolean column. It has a low cardinality since there are only 2 possible values -- true or false.
I assume you're asking because you probably came across it while learning about secondary indexes in Cassandra. If so, you might be interested in the document on when to use a secondary index. Cheers!
6 People are following this question.