SHOW INDEXES

NOTE! For improved performance, execute this command in the mz_introspection cluster. To switch clusters, use SET CLUSTER = mz_introspection;.

SHOW INDEXES provides details about indexes built on a source, view, or materialized view.

Syntax

SHOW INDEXES ON on_name FROM schema_name IN CLUSTER cluster_name LIKE pattern WHERE expr
Field Use
on_name The name of the object whose indexes you want to show. If omitted, all indexes in the cluster are shown.
schema_name The schema to show objects from. Defaults to public in the current database if neither on_name nor cluster_name are specified. For available schemas, see SHOW SCHEMAS.
cluster_name The cluster to show indexes from. If omitted, indexes from all clusters are shown.

Details

Output format

SHOW INDEX’s output is a table with the following structure:

name | on  | cluster | key
-----+-----+---------+----
 ... | ... | ...     | ...
Field Meaning
name The name of the index.
on The name of the table, source, or view the index belongs to.
cluster The name of the cluster containing the index.
key A text array describing the expressions in the index key.

Examples

SHOW VIEWS;
          name
-------------------------
 my_nonmaterialized_view
 my_materialized_view
SHOW INDEXES ON my_materialized_view;
 name | on  | cluster | key
------+-----+---------+----
 ...  | ... | ...     | ...
Back to top ↑