ngql 语句问题管道变量引用出现empty问题, 和match 语句比go from 慢怎么优化,还是match 就是慢??

提问参考模版:

  • nebula 版本:2.0.1
  • 部署方式(分布式 ):3个meta 6个storage ,6个 graph
  • 是否为线上版本:Y
  • 硬件信息
    • 磁盘ssd
    • CPU 32C、64G 内存信息
  • 问题的具体描述
  • 相关的 meta / storage / graph info 日志信息(尽量使用文本形式方便检索)

1.ngql 语句问题管道变量引用出现empty问题


引用的id这边都查看没有empty ,但管道引用报empty

2.match 语句比go from 慢怎么优化,还是match 就是慢??

MATCH (a)-[e:Person_representativeWork|Director_work|Scenarist_work|Actor_work ]->(t)
WHERE id(a) == 34580 and
(t.Thing_class CONTAINS "Film"
OR t.Thing_class CONTAINS "TvSeries"
OR t.Thing_class CONTAINS "TvShow"
OR t.Thing_class CONTAINS "Cartoon"
OR t.Thing_class CONTAINS "Documentary"
OR t.Thing_class CONTAINS "AudioVisualWork")
RETURN id(t) AS dst_id,t.Thing_name AS Thing_name,t.Thing_tag AS Thing_tag,t.Work_locationCreated AS Work_locationCreated,t.AudioVisualWork_datePlay AS AudioVisualWork_datePlay,t.Thing_class AS Thing_class

这个耗时400毫秒

go 1 steps from 34580 OVER Person_representativeWork,Director_work,Scenarist_work,Actor_work
WHERE $$.Thing.Thing_class CONTAINS "Film"
OR $$.Thing.Thing_class CONTAINS "TvSeries"
OR $$.Thing.Thing_class CONTAINS "TvShow"
OR $$.Thing.Thing_class CONTAINS "Cartoon"
OR $$.Thing.Thing_class CONTAINS "Documentary"
OR $$.Thing.Thing_class CONTAINS "AudioVisualWork"
YIELD DISTINCT  CASE Person_representativeWork._dst >-1 WHEN true THEN Person_representativeWork._dst ELSE 0 END
+CASE Director_work._dst >-1 WHEN true THEN Director_work._dst ELSE 0 END
+CASE Scenarist_work._dst >-1 WHEN true THEN Scenarist_work._dst ELSE 0 END
+CASE Actor_work._dst >-1 WHEN true THEN Actor_work._dst ELSE 0 END
AS dst_id, $$.Thing.Thing_name AS Thing_name,$$.Thing.Thing_tag AS Thing_tag,$$.Work.Work_locationCreated AS Work_locationCreated,$$.Work.AudioVisualWork_datePlay AS AudioVisualWork_datePlay,$$.Thing.Thing_class AS Thing_class

这个执行30毫秒

是我看漏掉了,抱歉,我让研发来看一眼

优先帮看一下第一个问题, 管道引用ID 报empty 问题

管道之前的语句,用console执行下,输出

查出的数据我都看了,都有值没有空,而且上面有空我都处理为0了,
GO FROM 34580 OVER Person_representativeWork,Director_work,Scenarist_work,Actor_work
WHERE $$.Thing.Thing_class CONTAINS “Film” OR $$.Thing.Thing_class CONTAINS "TvSeries"OR $$.Thing.Thing_class CONTAINS “TvShow” OR $$.Thing.Thing_class CONTAINS “Cartoon” OR $$.Thing.Thing_class CONTAINS “Documentary”
YIELD DISTINCT (CASE Person_representativeWork._dst >-1 WHEN true THEN Person_representativeWork._dst ELSE 0 END)
+(CASE Director_work._dst >-1 WHEN true THEN Director_work._dst ELSE 0 END)
+(CASE Scenarist_work._dst >-1 WHEN true THEN Scenarist_work._dst ELSE 0 END)
+(CASE Actor_work._dst >-1 WHEN true THEN Actor_work._dst ELSE 0 END)as VertexID
|GO FROM $-.VertexID OVER AudioVisualWork_role WHERE $$.Thing.Thing_name==“刘德华”
YIELD DISTINCT $-.VertexID as VertexID,$^.Thing.Thing_name AS Thing_name,$^.Thing.Thing_tag AS Thing_tag,$^.Thing.Thing_class AS Thing_class,$^.Work.Work_locationCreated AS Work_locationCreated,$^.Work.AudioVisualWork_datePlay AS AudioVisualWork_datePlay

用nebula console执行,不要用studio执行。

一样的结果

大神帮看一下,这边生产升级2.0 有点急啊,或者看能不能改成match 语句

469条里面,应该有空的,你排序或者自己检查下。我觉得是empty引入的问题。

我导出数据核对了没有一条空的

19.txt (13.9 KB)
这是查出的id 我看没有empty

我测试了其他数据返回1条数据也不行 还是报empty,可以肯定有bug

GO FROM 34580 OVER Person_representativeWork,Director_work,Scenarist_work,Actor_work
WHERE $$.Thing.Thing_class CONTAINS “Film” OR $$.Thing.Thing_class CONTAINS "TvSeries"OR $$.Thing.Thing_class CONTAINS “TvShow” OR $$.Thing.Thing_class CONTAINS “Cartoon” OR $$.Thing.Thing_class CONTAINS “Documentary”
YIELD DISTINCT (CASE Person_representativeWork._dst >-1 WHEN true THEN Person_representativeWork._dst ELSE 0 END)
+(CASE Director_work._dst >-1 WHEN true THEN Director_work._dst ELSE 0 END)
+(CASE Scenarist_work._dst >-1 WHEN true THEN Scenarist_work._dst ELSE 0 END)
+(CASE Actor_work._dst >-1 WHEN true THEN Actor_work._dst ELSE 0 END)as VertexID
|GO FROM $-.VertexID OVER AudioVisualWork_role WHERE $$.Thing.Thing_name==“刘德华”
YIELD $^.Thing.Thing_name AS Thing_name

试试吧

还是不行

麻烦让研发继续看一下问题1,生产使用比较急

go from 如果有bug ,这个可以帮把语句改成match 吗,

match 的性能目前还是需要优化一下下下

那这个问题怎么处理呀下个版本回修复这个bug 把,现在改用match 慢很多,帮忙优化一下
MATCH (a)-[e:Person_representativeWork|Director_work|Scenarist_work|Actor_work ]->(t)-[e2:AudioVisualWork_role]->(v3:Thing{Thing_name:“刘德华”})
WHERE id(a) == 34580 and
(t.Thing_class CONTAINS “Film”
OR t.Thing_class CONTAINS “TvSeries”
OR t.Thing_class CONTAINS “TvShow”
OR t.Thing_class CONTAINS “Cartoon”
OR t.Thing_class CONTAINS “Documentary”
OR t.Thing_class CONTAINS “AudioVisualWork”)
RETURN id(t) AS dst_id,t.Thing_name AS Thing_name,t.Thing_tag AS Thing_tag,t.Work_locationCreated AS Work_locationCreated,t.AudioVisualWork_datePlay AS AudioVisualWork_datePlay,t.Thing_class AS Thing_class
这个要1100ms

GO FROM 34580 OVER Person_representativeWork,Director_work,Scenarist_work,Actor_work
WHERE $$.Thing.Thing_class CONTAINS “Film” OR $$.Thing.Thing_class CONTAINS "TvSeries"OR $$.Thing.Thing_class CONTAINS “TvShow” OR $$.Thing.Thing_class CONTAINS “Cartoon” OR $$.Thing.Thing_class CONTAINS “Documentary”
YIELD DISTINCT (CASE Person_representativeWork._dst >-1 WHEN true THEN Person_representativeWork._dst ELSE 0 END)
+(CASE Director_work._dst >-1 WHEN true THEN Director_work._dst ELSE 0 END)
+(CASE Scenarist_work._dst >-1 WHEN true THEN Scenarist_work._dst ELSE 0 END)
+(CASE Actor_work._dst >-1 WHEN true THEN Actor_work._dst ELSE 0 END)as VertexID
|GO FROM $-.VertexID OVER AudioVisualWork_role WHERE $$.Thing.Thing_name==“刘德华”
YIELD DISTINCT $-.VertexID as VertexID,$^.Thing.Thing_name AS Thing_name,$^.Thing.Thing_tag AS Thing_tag,$^.Thing.Thing_class AS Thing_class,$^.Work.Work_locationCreated AS Work_locationCreated,$^.Work.AudioVisualWork_datePlay AS AudioVisualWork_datePlay

我们现在暂时没有支持case的结果做为id,因为case表达式的输出是不保证类型一致的。不过我们可以考虑在运行时忽略错误类型的id。你可以先把那个GO语句贴到我们的issue里面。

浙ICP备20010487号