> For the complete documentation index, see [llms.txt](https://litedb.gitbook.io/litedb-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://litedb.gitbook.io/litedb-docs/sql/ddl/vector_index/show_vindexes.md).

# SHOW VINDEXES

`SHOW VINDEXES` 用于查看当前数据库中指定集合的向量索引定义和 HNSW 参数。该语句必须明确指定集合，不能省略 `FROM`。

## 语法

```ebnf
show_vindexes_statement ::= SHOW VINDEXES FROM collection_name

collection_name ::= identifier
```

## 参数

| 参数                     | 说明                               |
| ---------------------- | -------------------------------- |
| `FROM collection_name` | 要查看向量索引的集合；集合必须属于当前 `USE` 选中的数据库 |

标量索引不包含在本语句结果中；请使用 [SHOW INDEXES](/litedb-docs/sql/ddl/scalar_index/show_indexes.md)。

## 返回结果

每个向量索引返回一行，列顺序和名称如下：

| 列名                | 类型        | 说明                                   |
| ----------------- | --------- | ------------------------------------ |
| `index_name`      | `VARCHAR` | 向量索引名称                               |
| `column_name`     | `VARCHAR` | 被索引的 `VECTOR(n)` 列名称                 |
| `type`            | `VARCHAR` | 索引类型，当前为 `HNSW`                      |
| `metric`          | `VARCHAR` | 距离度量：`L2`、`COSINE` 或 `INNER_PRODUCT` |
| `dimension`       | `BIGINT`  | 向量维度 `n`                             |
| `max_neighbors`   | `BIGINT`  | HNSW 最大邻居数                           |
| `ef_construction` | `BIGINT`  | 构建候选宽度                               |
| `ef_search`       | `BIGINT`  | 默认搜索候选宽度                             |
| `random_seed`     | `BIGINT`  | 随机种子                                 |

没有向量索引时，语句返回相同列结构但没有数据行。

## 示例

```sql
USE demo;

SHOW VINDEXES FROM documents;
```

可能得到如下结果：

| index\_name      | column\_name | type   | metric   | dimension | max\_neighbors | ef\_construction | ef\_search | random\_seed |
| ---------------- | ------------ | ------ | -------- | --------: | -------------: | ---------------: | ---------: | -----------: |
| `vidx_embedding` | `embedding`  | `HNSW` | `COSINE` |         3 |             24 |              240 |         80 |            7 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://litedb.gitbook.io/litedb-docs/sql/ddl/vector_index/show_vindexes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
