SHOW CREATE INDEX

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

语法

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

示例

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

  1. nebula> SHOW TAG INDEXES;
  2. +------------------+--------------+-----------------+
  3. | "player_index_0" | "player" | ["name"] |
  4. +------------------+--------------+-----------------+
  5. | "player_index_1" | "player" | ["name", "age"] |
  6. +------------------+--------------+-----------------+
  7. nebula> SHOW CREATE TAG INDEX player_index_1;
  8. +------------------+--------------------------------------------------+
  9. | Tag Index Name | Create Tag Index |
  10. +------------------+--------------------------------------------------+
  11. | "player_index_1" | "CREATE TAG INDEX `player_index_1` ON `player` ( |
  12. | | `name(20)` |
  13. | | )" |
  14. +------------------+--------------------------------------------------+

Edge type索引可以用类似的方法查询:

  1. nebula> SHOW EDGE INDEXES;
  2. +----------------+----------+---------+
  3. | Index Name | By Edge | Columns |
  4. +----------------+----------+---------+
  5. | "follow_index" | "follow" | [] |
  6. +----------------+----------+---------+
  7. nebula> SHOW CREATE EDGE INDEX follow_index;
  8. +-----------------+-------------------------------------------------+
  9. | Edge Index Name | Create Edge Index |
  10. +-----------------+-------------------------------------------------+
  11. | "follow_index" | "CREATE EDGE INDEX `follow_index` ON `follow` ( |
  12. | | )" |
  13. +-----------------+-------------------------------------------------+