跳转至

SHOW CREATE INDEX

SHOW CREATE INDEX展示创建标签或者边类型时使用的nGQL语句,其中包含索引的详细信息,例如其关联的属性。

语法

SHOW CREATE {TAG | EDGE} INDEX <index_name>;

示例

用户可以先运行SHOW TAG INDEXES查看有哪些标签索引,然后用SHOW CREATE TAG INDEX查看指定索引的创建信息。

nebula> SHOW TAG INDEXES;
+------------------+
| Names            |
+------------------+
| "player_index_0" |
+------------------+
| "player_index_1" |
+------------------+

nebula> SHOW CREATE TAG INDEX player_index_1;
+------------------+--------------------------------------------------+
| Tag Index Name   | Create Tag Index                                 |
+------------------+--------------------------------------------------+
| "player_index_1" | "CREATE TAG INDEX `player_index_1` ON `player` ( |
|                  |  `name(20)`                                      |
|                  | )"                                               |
+------------------+--------------------------------------------------+

边类型索引可以用类似的方法查询:

nebula> SHOW EDGE INDEXES;
+----------------+
| Names          |
+----------------+
| "index_follow" |
+----------------+

nebula> SHOW CREATE EDGE INDEX index index_follow;
+-----------------+-------------------------------------------------+
| Edge Index Name | Create Edge Index                               |
+-----------------+-------------------------------------------------+
| "index_follow"  | "CREATE EDGE INDEX `index_follow` ON `follow` ( |
|                 |  `degree`                                       |
|                 | )"                                              |
+-----------------+-------------------------------------------------+

最后更新: 2021年5月14日