Cassandra Secondary Index

Author: Al-mamun Sarkar Date: 2020-09-22 08:30:56

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 ;