Previous Next JavaScript must be enabled to correctly display this content

## DESCRIBE INDEX Statement

The DESCRIBE INDEX statement defines the specified index on a table.

Syntax

    describe_index_statement ::=
        (DESCRIBE | DESC) [AS JSON] INDEX index_name ON table_name

Semantics

If you want the output to be in JSON format, you can specify the optional AS JSON.

The description for the index contains the following information:

- Name of the table on which the index is defined.
- Name of the index.
- Type of index. Whether the index is primary index or secondary index.
- Whether the index is multikey? If the index is multikey then 'Y' is displayed. Otherwise, 'N' is displayed.
- List of fields on which the index is defined.
- The declared type of the index.
- Description of the index.

Example 8-17

The following statement provides information about the index `idx_income1` on the `UserInfo` table.

    DESCRIBE AS JSON INDEX idx_income1 ON UserInfo

Output:

    {
       "name" : "idx_income1",
       "type" : "secondary",
       "fields" : ["info.income"],
       "types" : ["ANY_ATOMIC"],
       "withNoNulls" : false,
       "withUniqueKeysPerRow" : false
    }

Example 8-18

The following statement provides information about the index `idx_phones` on the `UserInfo` table.

    DESCRIBE AS JSON INDEX idx_phones ON UserInfo

Output:

    {
      "name" : "idx_phones",
      "type" : "secondary",
      "fields" : ["info.phones[].number"],
      "types" :  ["INTEGER"],
      "withNoNulls" : false,
      "withUniqueKeysPerRow" : true
    }

Example 8-19

The following statement provides information about the index `idx_modtime` on the `users` table.

     DESCRIBE AS JSON INDEX idx_modtime ON users

Output:

    {
      "name" : "idx_modtime",
      "type" : "secondary",
      "fields" : ["modification_time#"],
      "withNoNulls" : false,
      "withUniqueKeysPerRow" : false
    }

Example 8-20

The following statement provides information about the index `idx_showid_year_month` on the `stream_acct` table.

     DESCRIBE AS JSON INDEX idx_showid_year_month ON stream_acct

Output:

    {
      "name" : "idx_showid_year_month",
      "type" : "secondary",
      "fields" : ["acct_data.contentStreamed[].showId", "substring#acct_data.contentStreamed[].seriesInfo[].episodes[].date@,0,4", "substring#acct_data.contentStreamed[].seriesInfo[].episodes[].date@,5,2"],
      "types" : ["INTEGER", "STRING", "STRING"],
      "withNoNulls" : false,
      "withUniqueKeysPerRow" : false
    }