DROP INDEX
We can drop a secondary index by using the DROP INDEX
statement.
Syntax:-
DROP INDEX index_name
Example:-
cqlsh:payroll> CREATE INDEX erank ON exam_year_name (rank); cqlsh:payroll> select * from exam_year_name where rank=1; exam_year | exam_name | rank | examlist_name -----------+---------------------------+------+--------------- 2015 | Public Service Commission | 1 | UPPSC 2015 | Teacher Eligibility Test | 1 | CTET (2 rows) cqlsh:payroll> Drop index erank; cqlsh:payroll>
Keep in Mind:-
- The DROP INDEX statement is used to drop an existing secondary index
- If the index does not exist, the statement will return an error. to avoid this use IF EXISTS
No comments:
Post a comment