若点均无属性,只有查边关系的时候会用到,那么不导入点,请问只导入边关系是否对各种查询都无影响?

  • nebula 版本:2.0.1
  • 是否为线上版本:Y

非常好的问题:+1:t2:,我试了一下,可以说这种用法不是系统被设计时候考虑过的情况,一些结果作为参考:

  • 基于 GO 的查询不受影响
  • 点统计是0(显然)
  • LOOKUP on edge 不受影响
  • MATCH 无法使用,结果是(空),因为 MATCH 的拓展会取点(而点不存在)
(root@nebula) [(none)]> use basketballplayer_edge_only
Execution succeeded (time spent 46995/51995 us)

Tue, 28 Sep 2021 13:08:00 CST

(root@nebula) [basketballplayer_edge_only]> $var = GO FROM "player100" OVER follow YIELD follow._dst AS id; $var1 = GO FROM $var.id OVER serve YIELD serve._dst AS team;
+-----------+
| team      |
+-----------+
| "team204" |
+-----------+
| "team215" |
+-----------+
| "team204" |
+-----------+
Got 3 rows (time spent 66288/80386 us)

Tue, 28 Sep 2021 13:20:33 CST

(root@nebula) [basketballplayer_edge_only]> submit job stats
+------------+
| New Job Id |
+------------+
| 21         |
+------------+
Got 1 rows (time spent 78811/84962 us)

Tue, 28 Sep 2021 13:20:49 CST

(root@nebula) [basketballplayer_edge_only]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 0     |
+---------+------------+-------+
| "Tag"   | "team"     | 0     |
+---------+------------+-------+
| "Edge"  | "follow"   | 81    |
+---------+------------+-------+
| "Edge"  | "serve"    | 152   |
+---------+------------+-------+
| "Space" | "vertices" | 0     |
+---------+------------+-------+
| "Space" | "edges"    | 233   |
+---------+------------+-------+
Got 6 rows (time spent 15565/29291 us)

Tue, 28 Sep 2021 13:20:53 CST

(root@nebula) [basketballplayer_edge_only]> CREATE EDGE INDEX follow_index on follow();
Execution succeeded (time spent 84934/94194 us)

Tue, 28 Sep 2021 13:24:35 CST

(root@nebula) [basketballplayer_edge_only]> REBUILD EDGE INDEX follow_index;
+------------+
| New Job Id |
+------------+
| 23         |
+------------+
Got 1 rows (time spent 99622/113218 us)

Tue, 28 Sep 2021 13:24:52 CST
(root@nebula) [basketballplayer_edge_only]> LOOKUP ON follow
+-------------+-------------+---------+
| SrcVID      | DstVID      | Ranking |
+-------------+-------------+---------+
| "player102" | "player100" | 0       |
+-------------+-------------+---------+
| "player102" | "player101" | 0       |
+-------------+-------------+---------+
| "player104" | "player100" | 0       |
+-------------+-------------+---------+
| "player104" | "player101" | 0       |
...



(root@nebula) [basketballplayer_edge_only]> MATCH (v:player { name: 'Tim Duncan' })--(v2) \
                                         ->         WHERE id(v2) IN ["player101", "player102"] RETURN v2;
+----+
| v2 |
+----+
+----+
Empty set (time spent 322531/510700 us)

Tue, 28 Sep 2021 13:21:45 CST

MATCH 在有点数据的情况下:

(root@nebula) [(none)]> use basketballplayer
#
(root@nebula) [basketballplayer]> MATCH (v:player { name: 'Tim Duncan' })--(v2) \
                               ->         WHERE id(v2) IN ["player101", "player102"] RETURN v2;
+-----------------------------------------------------------+
| v2                                                        |
+-----------------------------------------------------------+
| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) |
+-----------------------------------------------------------+
| ("player101" :player{age: 38, name: "Tony Parker"})       |
+-----------------------------------------------------------+
| ("player101" :player{age: 38, name: "Tony Parker"})       |
+-----------------------------------------------------------+
Got 3 rows (time spent 278934/389787 us)

Tue, 28 Sep 2021 13:22:00 CST

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。