DEDUP算子

提问参考模版:

  • nebula 版本:v2 rc1
  • 部署方式(分布式 / 单机 / Docker / DBaaS):单机
  • 硬件信息
    • 磁盘:SSD,500G
    • CPU:12核,32G
  • 问题的具体描述
    图模型设计的时候怎样才能避免尽量少的使用DEDUP算子呢?

你这里的 dedup 算子是指的执行计划中的 Dedup plan node 吗?如果是的话,那具体说说为什么想要减少吗?执行计划的生成基本遵循固定的模版,但是如果计划不优,我们可以定制一些规则 rule 来优化,比如消除你认为多余的 dedup 操作。

对的,就是使用PROFILE format分析查看的dedup算子,nGQL的查询几乎全是花在了dedup上面,设计图的时候怎样才能避免尽量少的会触发调用这个dedup算子呢?
我的查询路径跨越了7个节点。

能贴一下你 profile 的语句吗?最新的 master 我们有定义一些 rule 消除了部分的 dedup。

-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| id | name         | dependencies | profiling data                                                 | operator info                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 36 | Project      | 35           | ver: 0, rows: 262930, execTime: 334895us, totalTime: 334898us  | outputVar: [{"colNames":["t1","t2","reportName","reportID","ItemID","fit","ClauseID","rName","RID","t1Name","T1ID","T2ID","t2Name"],"name":"__Project_36","type":"DATASET"}]                                                                                       |
|    |              |              |                                                                | inputVar: __DataJoin_35                                                                                                                                                                                                                                            |
|    |              |              |                                                                | columns: $-.t1 AS t1,$-.t2 AS t2,$-.reportName AS reportName,$-.reportID AS reportID,$-.ItemID AS ItemID,$-.fit AS fit,$-.ClauseID AS ClauseID,$-.rName AS rName,$-.RID AS RID,$-.__COL_12 AS t1Name,$-.__COL_13 AS T1ID,$-.__COL_14 AS T2ID,$-.__COL_15 AS t2Name |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 35 | DataJoin     | 34           | ver: 0, rows: 262930, execTime: 88056us, totalTime: 88058us    | outputVar: [{"colNames":["__COL_12","__COL_13","__COL_14","_vid","__COL_16","__COL_15","__COL_17","t1","t2","reportName","reportID","ItemID","fit","ClauseID","rName","RID","T1ID"],"name":"__DataJoin_35","type":"DATASET"}]                                      |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_25":"0"},"leftVar":{"__DataJoin_34":"0"}}                                                                                                                                                                                        |
|    |              |              |                                                                | hashKeys: ["$__DataJoin_34._vid"]                                                                                                                                                                                                                                  |
|    |              |              |                                                                | probeKeys: ["$-.T1ID"]                                                                                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 34 | DataJoin     | 33           | ver: 0, rows: 274, execTime: 6924us, totalTime: 6926us         | outputVar: [{"colNames":["__COL_12","__COL_13","__COL_14","_vid","__COL_16","__COL_15","__COL_17"],"name":"__DataJoin_34","type":"DATASET"}]                                                                                                                       |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_33":"0"},"leftVar":{"__Project_29":"0"}}                                                                                                                                                                                         |
|    |              |              |                                                                | hashKeys: ["$__Project_29.__COL_16"]                                                                                                                                                                                                                               |
|    |              |              |                                                                | probeKeys: ["$__Project_33.__COL_17"]                                                                                                                                                                                                                              |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 33 | Project      | 32           | ver: 0, rows: 132, execTime: 389us, totalTime: 391us           | outputVar: [{"colNames":["__COL_15","__COL_17"],"name":"__Project_33","type":"DATASET"}]                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __GetVertices_32                                                                                                                                                                                                                                         |
|    |              |              |                                                                | columns: $$.T2.name AS __COL_15,$__GetVertices_32._vid AS __COL_17                                                                                                                                                                                                 |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 32 | GetVertices  | 31           | ver: 0, rows: 132, execTime: 230us, totalTime: 4015us          | outputVar: [{"colNames":[],"name":"__GetVertices_32","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __Dedup_31                                                                                                                                                                                                                                               |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $__Dedup_31.__COL_16                                                                                                                                                                                                                                          |
|    |              |              |                                                                | props: [{}]                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | exprs: []                                                                                                                                                                                                                                                          |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 31 | Dedup        | 30           | ver: 0, rows: 132, execTime: 155us, totalTime: 156us           | outputVar: [{"colNames":[],"name":"__Dedup_31","type":"DATASET"}]                                                                                                                                                                                                  |
|    |              |              |                                                                | inputVar: __Project_30                                                                                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 30 | Project      | 29           | ver: 0, rows: 274, execTime: 89us, totalTime: 90us             | outputVar: [{"colNames":["__COL_16"],"name":"__Project_30","type":"DATASET"}]                                                                                                                                                                                      |
|    |              |              |                                                                | inputVar: __Project_29                                                                                                                                                                                                                                             |
|    |              |              |                                                                | columns: $-.__COL_16 AS __COL_16                                                                                                                                                                                                                                   |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 29 | Project      | 28           | ver: 0, rows: 274, execTime: 974us, totalTime: 976us           | outputVar: [{"colNames":["__COL_12","__COL_13","__COL_14","_vid","__COL_16"],"name":"__Project_29","type":"DATASET"}]                                                                                                                                              |
|    |              |              |                                                                | inputVar: __GetNeighbors_28                                                                                                                                                                                                                                        |
|    |              |              |                                                                | columns: $^.T1.name AS __COL_12,follow._src AS __COL_13,follow._dst AS __COL_14,$__GetNeighbors_28._vid AS _vid,*._dst AS __COL_16                                                                                                                                 |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 28 | GetNeighbors | 27           | ver: 0, rows: 274, execTime: 122us, totalTime: 7041us          | outputVar: [{"colNames":[],"name":"__GetNeighbors_28","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Dedup_27                                                                                                                                                                                                                                               |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $-._vid                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps: [{}]                                                                                                                                                                                                                                                  |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","_src"],"type":"2175"}]                                                                                                                                                                                                               |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 27 | Dedup        | 26           | ver: 0, rows: 167, execTime: 11624933us, totalTime: 11624935us | outputVar: [{"colNames":["_vid"],"name":"__Dedup_27","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __Project_26                                                                                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 26 | Project      | 25           | ver: 0, rows: 210089, execTime: 36085us, totalTime: 36087us    | outputVar: [{"colNames":["_vid"],"name":"__Project_26","type":"DATASET"}]                                                                                                                                                                                          |
|    |              |              |                                                                | inputVar: __Project_25                                                                                                                                                                                                                                             |
|    |              |              |                                                                | columns: $-.T1ID AS _vid                                                                                                                                                                                                                                           |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 25 | Project      | 24           | ver: 0, rows: 210089, execTime: 236007us, totalTime: 236010us  | outputVar: [{"colNames":["t1","t2","reportName","reportID","ItemID","fit","ClauseID","rName","RID","T1ID"],"name":"__Project_25","type":"DATASET"}]                                                                                                                |
|    |              |              |                                                                | inputVar: __DataJoin_24                                                                                                                                                                                                                                            |
|    |              |              |                                                                | columns: $-.t1 AS t1,$-.t2 AS t2,$-.reportName AS reportName,$-.reportID AS reportID,$-.ItemID AS ItemID,$-.fit AS fit,$-.ClauseID AS ClauseID,$-.__COL_9 AS rName,$-.__COL_10 AS RID,$-.__COL_11 AS T1ID                                                          |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 24 | DataJoin     | 23           | ver: 0, rows: 210089, execTime: 64902us, totalTime: 64904us    | outputVar: [{"colNames":["__COL_9","__COL_10","__COL_11","_vid","t1","t2","reportName","reportID","ItemID","fit","ClauseID","RID"],"name":"__DataJoin_24","type":"DATASET"}]                                                                                       |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_19":"0"},"leftVar":{"__Project_23":"0"}}                                                                                                                                                                                         |
|    |              |              |                                                                | hashKeys: ["$__Project_23._vid"]                                                                                                                                                                                                                                   |
|    |              |              |                                                                | probeKeys: ["$-.RID"]                                                                                                                                                                                                                                              |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 23 | Project      | 22           | ver: 0, rows: 623, execTime: 488us, totalTime: 489us           | outputVar: [{"colNames":["__COL_9","__COL_10","__COL_11","_vid"],"name":"__Project_23","type":"DATASET"}]                                                                                                                                                          |
|    |              |              |                                                                | inputVar: __GetNeighbors_22                                                                                                                                                                                                                                        |
|    |              |              |                                                                | columns: $^.R.name AS __COL_9,follow._src AS __COL_10,follow._dst AS __COL_11,$__GetNeighbors_22._vid AS _vid                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 22 | GetNeighbors | 21           | ver: 0, rows: 623, execTime: 182us, totalTime: 19542us         | outputVar: [{"colNames":[],"name":"__GetNeighbors_22","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Dedup_21                                                                                                                                                                                                                                               |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $-._vid                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps: [{}]                                                                                                                                                                                                                                                  |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","_src"],"type":"2175"}]                                                                                                                                                                                                               |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 21 | Dedup        | 20           | ver: 0, rows: 505, execTime: 5922255us, totalTime: 5922257us   | outputVar: [{"colNames":["_vid"],"name":"__Dedup_21","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __Project_20                                                                                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 20 | Project      | 19           | ver: 0, rows: 155787, execTime: 23868us, totalTime: 23871us    | outputVar: [{"colNames":["_vid"],"name":"__Project_20","type":"DATASET"}]                                                                                                                                                                                          |
|    |              |              |                                                                | inputVar: __Project_19                                                                                                                                                                                                                                             |
|    |              |              |                                                                | columns: $-.RID AS _vid                                                                                                                                                                                                                                            |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 19 | Project      | 18           | ver: 0, rows: 155787, execTime: 146880us, totalTime: 146882us  | outputVar: [{"colNames":["t1","t2","reportName","reportID","ItemID","fit","ClauseID","RID"],"name":"__Project_19","type":"DATASET"}]                                                                                                                               |
|    |              |              |                                                                | inputVar: __DataJoin_18                                                                                                                                                                                                                                            |
|    |              |              |                                                                | columns: $-.t1 AS t1,$-.t2 AS t2,$-.reportName AS reportName,$-.reportID AS reportID,$-.ItemID AS ItemID,$-.fit AS fit,$-.__COL_7 AS ClauseID,$-.__COL_8 AS RID                                                                                                    |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 18 | DataJoin     | 17           | ver: 0, rows: 155787, execTime: 68746us, totalTime: 68749us    | outputVar: [{"colNames":["__COL_7","__COL_8","_vid","t1","t2","reportName","reportID","fit","ItemID","ClauseID"],"name":"__DataJoin_18","type":"DATASET"}]                                                                                                         |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_13":"0"},"leftVar":{"__Project_17":"0"}}                                                                                                                                                                                         |
|    |              |              |                                                                | hashKeys: ["$__Project_17._vid"]                                                                                                                                                                                                                                   |
|    |              |              |                                                                | probeKeys: ["$-.ClauseID"]                                                                                                                                                                                                                                         |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 17 | Project      | 16           | ver: 0, rows: 12866, execTime: 11528us, totalTime: 11530us     | outputVar: [{"colNames":["__COL_7","__COL_8","_vid"],"name":"__Project_17","type":"DATASET"}]                                                                                                                                                                      |
|    |              |              |                                                                | inputVar: __GetNeighbors_16                                                                                                                                                                                                                                        |
|    |              |              |                                                                | columns: follow._src AS __COL_7,follow._dst AS __COL_8,$__GetNeighbors_16._vid AS _vid                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 16 | GetNeighbors | 15           | ver: 0, rows: 12866, execTime: 2461us, totalTime: 140504us     | outputVar: [{"colNames":[],"name":"__GetNeighbors_16","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Dedup_15                                                                                                                                                                                                                                               |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $-._vid                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps:                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","_src"],"type":"2175"}]                                                                                                                                                                                                               |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 15 | Dedup        | 14           | ver: 0, rows: 13043, execTime: 5097522us, totalTime: 5097525us | outputVar: [{"colNames":["_vid"],"name":"__Dedup_15","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __Project_14                                                                                                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | Project      | 13           | ver: 0, rows: 158049, execTime: 23772us, totalTime: 23774us    | outputVar: [{"colNames":["_vid"],"name":"__Project_14","type":"DATASET"}]                                                                                                                                                                                          |
|    |              |              |                                                                | inputVar: __Project_13                                                                                                                                                                                                                                             |
|    |              |              |                                                                | columns: $-.ClauseID AS _vid                                                                                                                                                                                                                                       |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | Project      | 12           | ver: 0, rows: 158049, execTime: 111965us, totalTime: 111967us  | outputVar: [{"colNames":["t1","t2","reportName","reportID","fit","ItemID","ClauseID"],"name":"__Project_13","type":"DATASET"}]                                                                                                                                     |
|    |              |              |                                                                | inputVar: __DataJoin_12                                                                                                                                                                                                                                            |
|    |              |              |                                                                | columns: $-.t1 AS t1,$-.t2 AS t2,$-.reportName AS reportName,$-.reportID AS reportID,$-.__COL_4 AS fit,$-.__COL_5 AS ItemID,$-.__COL_6 AS ClauseID                                                                                                                 |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | DataJoin     | 11           | ver: 0, rows: 158049, execTime: 32146us, totalTime: 32149us    | outputVar: [{"colNames":["__COL_4","__COL_5","__COL_6","_vid","t1","t2","reportName","reportID","ItemID"],"name":"__DataJoin_12","type":"DATASET"}]                                                                                                                |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_7":"0"},"leftVar":{"__Project_11":"0"}}                                                                                                                                                                                          |
|    |              |              |                                                                | hashKeys: ["$__Project_11._vid"]                                                                                                                                                                                                                                   |
|    |              |              |                                                                | probeKeys: ["$-.ItemID"]                                                                                                                                                                                                                                           |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | Project      | 10           | ver: 0, rows: 87218, execTime: 55349us, totalTime: 55353us     | outputVar: [{"colNames":["__COL_4","__COL_5","__COL_6","_vid"],"name":"__Project_11","type":"DATASET"}]                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __GetNeighbors_10                                                                                                                                                                                                                                        |
|    |              |              |                                                                | columns: like.fit AS __COL_4,like._src AS __COL_5,like._dst AS __COL_6,$__GetNeighbors_10._vid AS _vid                                                                                                                                                             |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | GetNeighbors | 9            | ver: 0, rows: 87218, execTime: 15622us, totalTime: 137846us    | outputVar: [{"colNames":[],"name":"__GetNeighbors_10","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Dedup_9                                                                                                                                                                                                                                                |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $-._vid                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps:                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","_src","fit"],"type":"2177"}]                                                                                                                                                                                                         |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  9 | Dedup        | 8            | ver: 0, rows: 71, execTime: 71us, totalTime: 72us              | outputVar: [{"colNames":["_vid"],"name":"__Dedup_9","type":"DATASET"}]                                                                                                                                                                                             |
|    |              |              |                                                                | inputVar: __Project_8                                                                                                                                                                                                                                              |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  8 | Project      | 7            | ver: 0, rows: 161, execTime: 51us, totalTime: 51us             | outputVar: [{"colNames":["_vid"],"name":"__Project_8","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Project_7                                                                                                                                                                                                                                              |
|    |              |              |                                                                | columns: $-.ItemID AS _vid                                                                                                                                                                                                                                         |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  7 | Project      | 6            | ver: 0, rows: 161, execTime: 304us, totalTime: 304us           | outputVar: [{"colNames":["t1","t2","reportName","reportID","ItemID"],"name":"__Project_7","type":"DATASET"}]                                                                                                                                                       |
|    |              |              |                                                                | inputVar: __DataJoin_6                                                                                                                                                                                                                                             |
|    |              |              |                                                                | columns: $-.t1 AS t1,$-.__COL_0 AS t2,$-.__COL_1 AS reportName,$-.__COL_2 AS reportID,$-.__COL_3 AS ItemID                                                                                                                                                         |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  6 | DataJoin     | 5            | ver: 0, rows: 161, execTime: 177us, totalTime: 179us           | outputVar: [{"colNames":["__COL_0","__COL_1","__COL_2","__COL_3","_vid","t1","reportID"],"name":"__DataJoin_6","type":"DATASET"}]                                                                                                                                  |
|    |              |              |                                                                | inputVar: {"rightVar":{"__Project_1":"0"},"leftVar":{"__Project_5":"0"}}                                                                                                                                                                                           |
|    |              |              |                                                                | hashKeys: ["$__Project_5._vid"]                                                                                                                                                                                                                                    |
|    |              |              |                                                                | probeKeys: ["$-.reportID"]                                                                                                                                                                                                                                         |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  5 | Project      | 4            | ver: 0, rows: 161, execTime: 444us, totalTime: 446us           | outputVar: [{"colNames":["__COL_0","__COL_1","__COL_2","__COL_3","_vid"],"name":"__Project_5","type":"DATASET"}]                                                                                                                                                   |
|    |              |              |                                                                | inputVar: __GetNeighbors_4                                                                                                                                                                                                                                         |
|    |              |              |                                                                | columns: exist.timer AS __COL_0,$^.Report.name AS __COL_1,exist._src AS __COL_2,exist._dst AS __COL_3,$__GetNeighbors_4._vid AS _vid                                                                                                                               |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  4 | GetNeighbors | 3            | ver: 0, rows: 161, execTime: 90us, totalTime: 2936us           | outputVar: [{"colNames":[],"name":"__GetNeighbors_4","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __Dedup_3                                                                                                                                                                                                                                                |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $-._vid                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps: [{}]                                                                                                                                                                                                                                                  |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","_src","timer"],"type":"2172"}]                                                                                                                                                                                                       |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  3 | Dedup        | 2            | ver: 0, rows: 23, execTime: 17us, totalTime: 17us              | outputVar: [{"colNames":["_vid"],"name":"__Dedup_3","type":"DATASET"}]                                                                                                                                                                                             |
|    |              |              |                                                                | inputVar: __Project_2                                                                                                                                                                                                                                              |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  2 | Project      | 1            | ver: 0, rows: 23, execTime: 12us, totalTime: 12us              | outputVar: [{"colNames":["_vid"],"name":"__Project_2","type":"DATASET"}]                                                                                                                                                                                           |
|    |              |              |                                                                | inputVar: __Project_1                                                                                                                                                                                                                                              |
|    |              |              |                                                                | columns: $-.reportID AS _vid                                                                                                                                                                                                                                       |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  1 | Project      | 0            | ver: 0, rows: 23, execTime: 53us, totalTime: 55us              | outputVar: [{"colNames":["t1","reportID"],"name":"__Project_1","type":"DATASET"}]                                                                                                                                                                                  |
|    |              |              |                                                                | inputVar: __GetNeighbors_0                                                                                                                                                                                                                                         |
|    |              |              |                                                                | columns: has.timer AS t1,has._dst AS reportID                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|  0 | GetNeighbors | 38           | ver: 0, rows: 23, execTime: 103us, totalTime: 1619us           | outputVar: [{"colNames":[],"name":"__GetNeighbors_0","type":"DATASET"}]                                                                                                                                                                                            |
|    |              |              |                                                                | inputVar: __VAR_0                                                                                                                                                                                                                                                  |
|    |              |              |                                                                | space: 2160                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | dedup: false                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | limit: 9223372036854775807                                                                                                                                                                                                                                         |
|    |              |              |                                                                | filter:                                                                                                                                                                                                                                                            |
|    |              |              |                                                                | orderBy: []                                                                                                                                                                                                                                                        |
|    |              |              |                                                                | src: $__VAR_0._vid                                                                                                                                                                                                                                                 |
|    |              |              |                                                                | edgeTypes: []                                                                                                                                                                                                                                                      |
|    |              |              |                                                                | edgeDirection: OUT_EDGE                                                                                                                                                                                                                                            |
|    |              |              |                                                                | vertexProps:                                                                                                                                                                                                                                                       |
|    |              |              |                                                                | edgeProps: [{"props":["_dst","timer"],"type":"2171"}]                                                                                                                                                                                                              |
|    |              |              |                                                                | statProps:                                                                                                                                                                                                                                                         |
|    |              |              |                                                                | exprs:                                                                                                                                                                                                                                                             |
|    |              |              |                                                                | random: false                                                                                                                                                                                                                                                      |
-----+--------------+--------------+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 38 | Start        |              | ver: 0, rows: 0, execTime: 1us, totalTime: 102us               | outputVar: [{"colNames":[],"name":"__Start_38","type":"DATASET"}]                                                                                                                                                                                                  |
-----+--------------+--------------+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

可以试试最新的 master 分支,对这块有优化,删除了部分不必要的 dedup 和 project。执行计划其实跟如何建模关系不是很直接,如何建模只要写相似的查询就会生成相似的计划。

nebula 执行计划的优化现在还处于刚起步的阶段,会有许多不完善的地方,不过这也是积累的过程,现在还有很多显而易见的规则没来及做,今年会在这块持续的投入,让 query 跑的更快。

nebula v1会比v2性能好吗?查询是否会更快一点哦,谢谢

GA 版本的性能目标是 v2 不比 v1 差,后续小版本开始着力性能优化,因为 v2 上面可以优化的点很多,前期主要在适配 1.0 的功能和部分支持 match 的特性上,很多优化的点还没来及做,但是可以预见的是 v2 的性能以后肯定会比 v1 好。

2赞

浙ICP备20010487号