Indexing concepts

The data stored in CQL tables can be queried by a variety of methods. The main method uses the partition key defined for a table, and is called primary indexing. However, often a query must be selected using another column of a table, and secondary indexing is required. Secondary indexing use fast, efficient lookup of data that matches a given condition.

Astra DB Serverless has the following types of indexing available:

Indexing type Astra DB Serverless Astra DB Classic Apache Astra DB Serverless DataStax Enterprise (DSE)

Primary indexing

Storage-attached indexing (SAI)

Secondary indexing (2i)

DSE Search indexing

After any index is created, data can be queried using that index.

Primary indexing

The primary index is the partition key in Astra DB Serverless. The storage engine of Astra DB Serverless uses the partition key to store rows of data, and the most efficient and fast lookup of data matches the partition key.

Storage-attached indexing (SAI)

SAI uses indexes for non-partition columns, and attaches the indexing information to the SSTables that store the rows of data. SAI is the most appropriate indexing method for most use cases.

Secondary indexing (2i)

Secondary indexing are the original built-in indexes for Astra DB Serverless. These indexes are a local index, stored in a hidden table on each node of a Astra DB Serverless cluster, separate from the table that contains the values being indexed. This indexing method is only recommended when used in conjunction with a partition key.

DSE Search indexing

DataStax Enterprise (DSE) also features a Apache Solr-Apache Lucene search indexing method. This indexing method focuses on tokenized text search.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com