Cassandra Documentation

Version:

You are viewing the documentation for a prerelease version.

Secondary index (2i) concepts

Secondary indexing (2i) is a globally-distributed index for Cassandra databases.

2i is the original secondary indexing of Apache Cassandra, but today, it suffers from poor performance and latency. If you are building new indexing, use SAI indexing instead.

2i adds column-level indexes to any CQL table column of any CQL data type, except for a counter column. However, the indexes are locally built on each Apache Cassandra node in a cluster, so using 2i for queries results in poor performance. A number of techniques exist for guarding against the undesirable scenario where data might be incorrectly retrieved during a query based on stale values in an index.

There are distinct conditions about when and when not to use a 2i index.