SHOW INDEXES (STANDARD TABLE)

Lists secondary indexes on a standard table.

See also:

Secondary indexes , SEARCH_OPTIMIZATION_HISTORY view

Syntax

SHOW INDEXES IN TABLE <table_name>

Parameters

IN TABLE table_name

Specifies the standard table whose secondary indexes are listed. Views, materialized views, and Iceberg tables aren’t supported.

Output

Key expressions and included expressions are ordered lists, shown in square brackets.

ColumnDescription
created_onDate and time when the index was created.
nameName of the index. The name is unique for the base table.
is_uniqueWhether the index is unique. A secondary index on a standard table isn’t a unique index.
tableName of the base table.
key_expressionsOrdered list of key expressions, shown in square brackets.
included_expressionsOrdered list of INCLUDE expressions, shown in square brackets.
database_nameDatabase that contains the index.
schema_nameSchema that contains the index.
ownerRole that owns the index.
status

Status of the index:

  • ACTIVE: The index can be used to retrieve data.
  • INVALID: The index can’t be used to retrieve data.
status_infoAdditional detail about the index status.
owner_role_typeRole type of the owner.
kindType of index. The value is ANALYTICAL TABLE INDEX.
progress_percentageBuild progress for the index. The value is an integer from 0 through 100.
storage_bytesStorage used by the index, in bytes.

Usage notes

  • Lists indexes for one table. This command doesn’t list secondary indexes at the schema, database, or account level.
  • kind is ANALYTICAL TABLE INDEX.
  • The command doesn’t require a running warehouse to execute.
  • The command only returns objects for which the current user’s current role has been granted at least one access privilege.
  • The MANAGE GRANTS access privilege implicitly allows its holder to see every object in the account. By default, only the account administrator (users with the ACCOUNTADMIN role) and security administrator (users with the SECURITYADMIN role) have the MANAGE GRANTS privilege.
  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

Examples

List the secondary indexes on table_a:

SHOW INDEXES IN TABLE table_a;