Javatpoint Logo
Javatpoint Logo

Cassandra Create Index

CREATE INDEX command is used to create an index on the column specified by the user. If the data already exists for the column which you choose to index, Cassandra creates indexes on the data during the 'create index' statement execution.


Rules for creating Index

  • The index cannot be created on primary key as a primary key is already indexed.
  • In Cassandra, Indexes on collections are not supported.
  • Without indexing on the column, Cassandra can't filter that column unless it is a primary key.


Let's take an example to demonstrate how to create index on a column. Here we create an index to a column "student_name" in the table "student".

Prior table:

Cassandra Create index 1
Cassandra Create index 2

Index is created on the column "student_name".

Note: You can verify that the index is created or not, by using the creating index query once again. It will show a message that index is already created.

Youtube For Videos Join Our Youtube Channel: Join Now


  • Send your Feedback to

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA