Skip to content

Commit

Permalink
Add profile and explain command for console (#2437)
Browse files Browse the repository at this point in the history
follow up of vesoft-inc/nebula-console#186
This will be highlighted in forum and GitHub issues too to avoid user sharing
pictures from the console or studio, or CSV outputs
  • Loading branch information
wey-gu authored Jan 5, 2023
1 parent ab093fe commit 5394d38
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs-2.0/nebula-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Nebula Console 可以保存参数,用于参数化查询。

### 导出执行结果

导出命令执行的返回结果,可以保存为 CSV 文件或 DOT 文件
导出命令执行的返回结果,可以保存为 CSV 文件、 DOT 文件或者 Prfile/Explain 结果

!!! note

Expand Down Expand Up @@ -137,6 +137,31 @@ Nebula Console 可以保存参数,用于参数化查询。
nebula> PROFILE FORMAT="dot" GO FROM "player100" OVER follow;
```

- 导出 PROFILE/EXPLAIN 结果到文件命令如下:

```ngql
nebula> :profile <file_name>;
```
或者

```ngql
nebula> :explain <file_name>;
```

!!! note
- 相比于 studio 中的截图、CSV 文件,因为保有更多信息量和拥有更好的可读性,经由此命令输出的文本文件内容是首推的在 GitHub issue、论坛中报告执行计划、图查询调优的方式。

示例:

```ngql
nebula> :profile profile.log
nebula> PROFILE GO FROM "player102" OVER serve YIELD dst(edge);
nebula> :profile profile.dot
nebula> PROFILE FORMAT="dot" GO FROM "player102" OVER serve YIELD dst(edge);
nebula> :explain explain.log
nebula> EXPLAIN GO FROM "player102" OVER serve YIELD dst(edge);
```

### 加载测试数据集

测试数据集名称为 basketballplayer,详细 Schema 信息和数据信息请使用相关`SHOW`命令查看。
Expand Down

0 comments on commit 5394d38

Please sign in to comment.