Apache Cassandra Index Type

SASI Indexes (Legacy) in Apache Cassandra: How It Works and When to Use It

SASI was an experimental secondary-index implementation with modes such as PREFIX, CONTAINS, and SPARSE. It is a legacy, version-dependent feature.

What Is a SASI Indexes (Legacy) in Apache Cassandra?

SASI was an experimental secondary-index implementation with modes such as PREFIX, CONTAINS, and SPARSE. It is a legacy, version-dependent feature.

How the SASI Indexes (Legacy) Algorithm Works

SASI was an experimental secondary-index implementation with modes such as PREFIX, CONTAINS, and SPARSE. It is a legacy, version-dependent feature.

Diagram showing the SASI Indexes (Legacy) lookup algorithm
Conceptual SASI Indexes (Legacy) algorithm. Exact behavior depends on the database version and query plan.

When to Use SASI Indexes (Legacy)

Understanding older Cassandra deployments that already depend on SASI and planning migration.

How to Create a Apache Cassandra SASI Indexes (Legacy)

Review data quality, existing structures, feature support, build time, and deployment requirements before creating an index on a production table.

CREATE CUSTOM INDEX users_name_sasi ON users (name) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'PREFIX'};

SASI Indexes (Legacy) Query Example

This example demonstrates the matching query shape. Check the execution plan to confirm that the engine can use the index.

SELECT user_id FROM users WHERE name LIKE 'Ava%';

Queries Supported by SASI Indexes (Legacy)

Understanding older Cassandra deployments that already depend on SASI and planning migration. A similar-looking predicate may not use the same access path; operators, expressions, key order, and data type all matter.

Read Performance, Storage, and Write Costs

Experimental status and version limitations increase upgrade and operations risk. Indexes reduce some search work but require storage and add maintenance to writes.

SASI Indexes (Legacy) Limitations and Common Mistakes

Do not adopt SASI in new systems without explicit release support; prefer supported SAI or query-driven tables.

Do not assume that an index being present means the optimizer chose it or that the query became selective.

How to Measure and Tune SASI Indexes (Legacy)

Inventory SASI dependencies, review release notes, and test replacement semantics before migration.

Compare representative plans and timings before and after, including concurrent writes and realistic data volumes.

SASI Indexes (Legacy) Questions

Will the database always use this index?

No. The optimizer weighs selectivity, estimated costs, statistics, cache state, and the amount of data returned.

What should I verify before production?

Confirm version support, query compatibility, write overhead, build/rollback procedures, and index behavior during backup and recovery.

Official Apache Cassandra Index Documentation

Check Apache Cassandra documentation: Indexing concepts for release-specific requirements and supported operators.