SHOW CREATE INDEX

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

语法

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

示例

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

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

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

  1. nebula> SHOW EDGE INDEXES;
  2. +----------------+
  3. | Names |
  4. +----------------+
  5. | "index_follow" |
  6. +----------------+
  7. nebula> SHOW CREATE EDGE INDEX index index_follow;
  8. +-----------------+-------------------------------------------------+
  9. | Edge Index Name | Create Edge Index |
  10. +-----------------+-------------------------------------------------+
  11. | "index_follow" | "CREATE EDGE INDEX `index_follow` ON `follow` ( |
  12. | | `degree` |
  13. | | )" |
  14. +-----------------+-------------------------------------------------+