SHOW INDEX

Lists all indexes on the specified table.

Syntax

SHOW INDEX { IN | FROM } [schema.]table_name [LIMIT num];

Parameters

ParameterRequiredDescription
IN | FROMYesKeyword, both are equivalent
schemaNoThe name of the Schema where the table resides. If not specified, the current Schema is used
table_nameYesThe name of the table whose indexes to query
LIMIT numNoLimits the number of indexes returned

Return Columns

ColumnDescription
index_nameThe name of the index
index_typeThe index type, such as inverted (inverted index), bloom_filter (Bloom filter), vector (vector index)

Examples

  1. View all indexes on the doc_test.employees table:

SHOW INDEX FROM doc_test.employees;

+---------------+------------+ | index_name | index_type | +---------------+------------+ | idx_emp_name | inverted | +---------------+------------+

  1. View indexes on the orders table in the current Schema:

SHOW INDEX FROM orders;

  1. View indexes on a table, returning at most 5 results:

SHOW INDEX IN doc_test.employees LIMIT 5;

  1. If no indexes exist on the table, an empty result set is returned:

SHOW INDEX FROM doc_test.departments; -- Returns 0 rows

Notes

  • If no indexes have been created on the table, the command returns an empty result set without an error.
  • Supported index types include: inverted index (inverted), Bloom filter (bloom_filter), and vector index (vector).
  • To view index details (including indexed columns, properties, size, etc.), use the DESC INDEX or DESC INDEX EXTENDED command.
  • To create an index, see Create Inverted Index; to build an index on existing data, see Build Index.