Dropping an index

Dropping a secondary index on a table is a simple task:

DROP INDEX [index_name]

If you do not know the name of the index (or created it without a name), you can describe the table to find it. Indexes on a table will appear at the bottom of the definition. Then you can DROP it:

CREATE INDEX ON query_test(c5);DESC TABLE query_test ;CREATE TABLE packt_ch3.query_test (   pk1 text,   pk2 text,   ck3 text,   ck4 text,   c5 text,   PRIMARY KEY ((pk1, pk2), ck3, ck4)) WITH CLUSTERING ORDER BY (ck3 DESC, ck4 ASC)...   AND speculative_retry = '99PERCENTILE';CREATE INDEX query_test_c5_idx ON packt_ch3.query_test (c5);DROP INDEX query_test_c5_idx ;

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.