Cassandra Indexing

Author: Al-mamun Sarkar Date: 2020-09-20 05:18:36

The CREATE INDEX command is used to create an index in the Cassandra table. In this lesson, I will show you how to create and drop index in Cassandra.

Note: You can't create an index on PRIMARY KEY because the primary key is already an index. Cassandra can't filter a column without indexing. 

Creating Index:

Syntax:

CREATE INDEX index_identifier ON table_info

Example:

CREATE INDEX emploayee_name_index ON employees (name) ;

 

 Creating Index:

Syntax:

DROP INDEX index_identifier

Example:

DROP INDEX emploayee_name_index;