Cassandra Indexing

Cassandra Indexing

Instructor-svgAl-Mamun Sarkar
Sep 20 , 2020

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;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram