> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW INDEX

> SHOW INDEX displays bitmap index information for a specified table.

## 功能

查看索引，当前仅支持查看指定表的所有 [Bitmap 索引](/documents/cn/4.2/table_design/indexes/Bitmap_index.md)。创建 bitmap 索引为异步过程，使用该语句只能查看到已经创建完成的索引。

**Tip**

该操作不需要权限。

## 语法

```SQL theme={null}
SHOW INDEX[ES] FROM [db_name.]table_name [FROM db_name]
```

或

```SQL theme={null}
SHOW KEY[S] FROM [db_name.]table_name [FROM db_name]
```

## 参数说明

| **参数** | **必选** | **说明** |
| - | - | - |
| db\_name | 否 | 数据库名称。 |
| table\_name | 是 | 表名。 |

## 返回结果说明

```Plain theme={null}
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table   | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
```

返回结果中的参数说明：

| **参数** | **说明** |
| - | - |
| Key\_name | 索引名称。 |
| Column\_name | 创建索引的列名。 |
| Index\_type | 索引类型。 |
| Comment | 索引备注。 |

> 说明：当前仅支持查看 bitmap 索引，bitmap 索引的相关信息仅包括以上四个参数。返回结果中的其他参数和 bitmap 索引无关。

## 示例

为表`sales_records`中的`item_id`列创建 bitmap 索引，索引名称为`index3`。表`sales_records`所属数据库为`d0`。

```SQL theme={null}
CREATE INDEX index3 ON sales_records (item_id) USING BITMAP COMMENT '';
```

查看表`sales_records`的所有索引。

```Plain theme={null}
SHOW INDEX FROM d0.sales_records;

+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table                            | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| d0.sales_records |            | index3   |              | item_id     |           |             |          |        |      | BITMAP     | NULL    |
+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
```

或

```Plain theme={null}
SHOW KEY FROM sales_records FROM d0;

+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table                            | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| d0.sales_records |            | index3   |              | item_id     |           |             |          |        |      | BITMAP     | NULL    |
+----------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.