DESCRIBE INDEX
Shows the definition of a specified index as an executable CQL statement.
For Solr indexes, use DESCRIBE SEARCH INDEX.
|
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 SASI index
-
DESCRIBE INDEX cycling.cyclist_name_sasi_idx;CREATE CUSTOM INDEX cyclist_name_sasi_idx ON cycling.country_flag (cyclist_name) USING 'org.apache.cassandra.index.sasi.SASIIndex';