DESCRIBE INDEX
Shows the definition of a specified index as an executable CQL statement.
|
To get all indexes for a table, use |
Synopsis
DESCRIBE INDEX <keyspace_name>.<index_name>
- keyspace_name
-
Name of the keyspace
- index_name
-
Name of the index. If an index name was not specified when the index was created, the default name is the column name, underscore, followed by idx.
Examples
- Verify that an index was created
-
-
Create an index:
CREATE INDEX nationality_idx ON cycling.cyclist_alt_stats (nationality); -
Show the definition of the index:
DESC INDEX cycling.nationality_idxIf the index exists, the result is the index definition as an executable CQL statement. It should be similar to the statement used to create the index.
CREATE INDEX nationality_idx ON cycling.cyclist_alt_stats (nationality);
-
- Describe SAI index
-
DESCRIBE INDEX cycling.rank_idx;CREATE CUSTOM INDEX rank_idx ON cycling.rank_by_year_and_name (rank) USING 'StorageAttachedIndex'; - Describe 2i index
-
DESCRIBE INDEX cycling.blist_keys_idx;CREATE INDEX blist_keys_idx ON cycling.birthday_list (keys(blist)); - Describe Kafka index
-
DESCRIBE INDEX ks.products_kafka;CREATE CUSTOM INDEX products_kafka ON ks.products (name, price) USING 'KafkaReplicator' WITH OPTIONS = {'topicName': 'ks.products', 'createTopicIfNotExists': 'true'}; - Describe OpenSearch index
-
DESCRIBE INDEXisn’t supported for OpenSearch indexes. To view the index definition, useDESCRIBE TABLEorDESCRIBE KEYSPACEinstead.