I am creating a batch job to flush all the data available in my keyspace. When I use the command DROP KEYSPACE <keyspace>
, tables and data are getting cleared while the secondary index created for each table is not dropped. Is there a way to delete all the indices available in a particular keyspace using CQL? Should I mention each index name available in the keyspave like
DROP INDEX <indexname>
Please help me on this. Thanks
To your question of how to delete a secondary index, the command is indeed DROP INDEX, as you mentioned.
To the question of whether secondary indexes are being deleted when they keyspace they belong to is dropped, as Mikhail mentioned that should be happening (i.e. DROP KEYSPACE should remove everything). If you have a case where it isn't, that could be a bug in Cassandra.