diff --git a/docs-2.0/3.ngql-guide/17.query-tuning-statements/1.explain-and-profile.md b/docs-2.0/3.ngql-guide/17.query-tuning-statements/1.explain-and-profile.md index 4b567fca9ab..c6449cfcce1 100644 --- a/docs-2.0/3.ngql-guide/17.query-tuning-statements/1.explain-and-profile.md +++ b/docs-2.0/3.ngql-guide/17.query-tuning-statements/1.explain-and-profile.md @@ -17,18 +17,18 @@ For example, a `SHOW TAGS` statement is processed into two `actions` and assigne * `EXPLAIN` ```ngql - EXPLAIN [format= {"row" | "dot"}] ; + EXPLAIN [format= {"row" | "dot" | "tck"}] ; ``` * `PROFILE` ```ngql - PROFILE [format= {"row" | "dot"}] ; + PROFILE [format= {"row" | "dot" | "tck"}] ; ``` ## Output formats -The output of an `EXPLAIN` or a `PROFILE` statement has two formats, the default `row` format and the `dot` format. You can use the `format` option to modify the output format. Omitting the `format` option indicates using the default `row` format. +The output of an `EXPLAIN` or a `PROFILE` statement has three formats, the default `row` format, the `dot` format, and the `tck` format. You can use the `format` option to modify the output format. Omitting the `format` option indicates using the default `row` format. ## The `row` format @@ -114,3 +114,39 @@ Execution Plan The Graphviz graph transformed from the above DOT statement is as follows. ![Graphviz graph of EXPLAIN SHOW TAGS](https://docs-cdn.nebula-graph.com.cn/docs-2.0/3.ngql-guide/16.query-tuning-statements/explain-show-tags.png) + +## The `tck` format + +The tck format is similar to a table, but without borders and dividing lines between rows. You can use the results as test cases for unit testing. +For information on tck format test cases, see [TCK cases](https://github.com/vesoft-inc/nebula/tree/master/tests/tck/features). + +- `EXPLAIN` + + ```ngql + nebula> EXPLAIN format="tck" FETCH PROP ON player "player_1","player_2","player_3" YIELD properties(vertex).name as name, properties(vertex).age as age; + Execution succeeded (time spent 261µs/613.718µs) + Execution Plan (optimize time 28 us) + | id | name | dependencies | profiling data | operator info | + | 2 | Project | 1 | | | + | 1 | GetVertices | 0 | | | + | 0 | Start | | | | + + Wed, 22 Mar 2023 23:15:52 CST + ``` + +- `PROFILE` + + ```ngql + nebula> PROFILE format="tck" FETCH PROP ON player "player_1","player_2","player_3" YIELD properties(vertex).name as name, properties(vertex).age as age; + | name | age | + | "Piter Park" | 24 | + | "aaa" | 24 | + | "ccc" | 24 | + Got 3 rows (time spent 1.474ms/2.19677ms) + Execution Plan (optimize time 41 us) + | id | name | dependencies | profiling data | operator info | + | 2 | Project | 1 | {"rows":3,"version":0} | | + | 1 | GetVertices | 0 | {"resp[0]":{"exec":"232(us)","host":"127.0.0.1:9779","total":"758(us)"},"rows":3,"total_rpc":"875(us)","version":0} | | + | 0 | Start | | {"rows":0,"version":0} | | + Wed, 22 Mar 2023 23:16:13 CST + ```