Apache Cassandra Index Type

Storage-Attached Vector Indexes in Apache Cassandra: How It Works and When to Use It

Cassandra 5 SAI can index vector columns for approximate nearest-neighbor search. The coordinator selects candidates across distributed token ranges; vector similarity is distinct from partition-key equality.

What Is a Storage-Attached Vector Indexes in Apache Cassandra?

Cassandra 5 SAI can index vector columns for approximate nearest-neighbor search. The coordinator selects candidates across distributed token ranges; vector similarity is distinct from partition-key equality.

How the Storage-Attached Vector Indexes Algorithm Works

Cassandra 5 SAI can index vector columns for approximate nearest-neighbor search. The coordinator selects candidates across distributed token ranges; vector similarity is distinct from partition-key equality.

Diagram showing the Storage-Attached Vector Indexes lookup algorithm
Conceptual Storage-Attached Vector Indexes algorithm. Exact behavior depends on the database version and query plan.

When to Use Storage-Attached Vector Indexes

Similarity search for embeddings in a Cassandra 5 deployment that supports SAI vector operations.

How to Create a Apache Cassandra Storage-Attached Vector Indexes

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

CREATE CUSTOM INDEX IF NOT EXISTS embedding_sai ON documents (embedding) USING 'StorageAttachedIndex';

Storage-Attached Vector Indexes Query Example

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

SELECT id FROM documents ORDER BY embedding ANN OF [0.12, 0.37, 0.81] LIMIT 10;

Queries Supported by Storage-Attached Vector Indexes

Similarity search for embeddings in a Cassandra 5 deployment that supports SAI vector operations. 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

Vector data and SAI consume substantial memory, disk, and CPU; replica fan-out and result quality need workload-specific testing. Indexes reduce some search work but require storage and add maintenance to writes.

Storage-Attached Vector Indexes Limitations and Common Mistakes

Requires supported Cassandra release and vector type/operator; ANN results are approximate and are not a substitute for every exact filter.

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

How to Measure and Tune Storage-Attached Vector Indexes

Confirm vector dimensions, similarity behavior, release requirements, replica coverage, recall, latency, and write costs.

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

Storage-Attached Vector Indexes 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 Cassandra 5.0 SAI and vector search documentation for release-specific requirements and supported operators.