Open polyominal opened 1 year ago
@polyominal tested on the provided dataset, both of the two queries finished within about 500ms:
(root@nebula) [test]> MATCH (n1:L5:L1:L2)-[r1]->(n2:L4:L0:L2:L3)-[r2]->(n3:L2:L4:L5:L0:L3), (n4:L3)-[:T2|T0|T1]-(n5)-[r3:T1|T0|T2|T5]->(n4:L3:L1:L5)-[:T0|T1|T2]-(n3), (n6)<-[:T2|T4|T3]-(n2:L0:L5:L2:L4), (n7:L5)-[r4:T4|T2]->(n8:L4)<-[r5:T3]-(n5:L4:L2)<-[r6]-(n9:L2:L5:L3:L4:L0) RETURN count(*)
+----------+
| count(*) |
+----------+
| 0 |
+----------+
Got 1 rows (time spent 458.21ms/492.015053ms)
Mon, 03 Jul 2023 11:48:46 CST
(root@nebula) [test]> MATCH (n3:L5:L0)-[:T0|T1|T2]-(n4:L3:L1:L5)<-[r3:T1|T0|T2|T5]-(n5:L4:L2), (n3:L2:L4:L5:L3)<-[r2]-(n2:L0:L2:L5), (n9:L2:L5:L3:L4:L0)-[r6]->(n5), (n6)<-[:T2|T4|T3]-(n2:L4:L0:L3:L5)<-[r1]-(n1:L5:L1:L2), (n4:L3:L5)-[:T2|T0|T1]-(n5:L4)-[r5:T3]->(n8:L4)<-[r4:T4|T2]-(n7:L5) RETURN count(*)
+----------+
| count(*) |
+----------+
| 0 |
+----------+
Got 1 rows (time spent 513.922ms/548.525049ms)
Mon, 03 Jul 2023 11:48:50 CST
(root@nebula) [test]>
(root@nebula) [test]>
@polyominal same as #5616, some error happend while preparing the data, after correting the error we can successfully reproduce the issue described above, thanks for reporting.
Bug Description
The following two equivalent (as one could verify) queries exhibit a substantial performance difference in their execution times.
Query 1:
Query 2:
Environments
Linux nn 5.19.0-41-generic #42~22.04.1-Ubuntu
How To Reproduce
Steps to reproduce the behavior:
Expected behavior Given the logical equivalence of the two queries, they should ideally have similar execution times. However, on our test system, the first query finishes within a second, while the second one does not finish even after 30 seconds.