Cassandra Secondary Index

Cassandra Secondary Index

Instructor-svgAl-Mamun Sarkar
Sep 22 , 2020

In Cassandra, the Secondary Index is used to perform a query with a non-primary key. In this lesson, I will show you how to create and delete the secondary index.

 

Cassandra Secondary Index:

Creating Secondary Index:

CREATE INDEX employee_city
ON employees (city);

Now we can user city on WHERE CLAUSE:

SELECT city, name 
FROM employees 
WHERE city = 'Dhaka';

Drop a Index:

DROP INDEX employee_city ;

 

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