gpt4 book ai didi

neo4j - 多个neo4j节点加入: "This query builds a cartesian product between disconnected patterns"

转载 作者:行者123 更新时间:2023-12-01 01:35:09 25 4
gpt4 key购买 nike

我正在运行这个查询:

MATCH (a:TEST:LOC1),(b:TEST_JOIN:LOC1),(c:TEST:LOC1)
WHERE a._out = b._in and b._out = c._in and c._text = 'P'
CREATE (a)-[r:TEST_JOIN]->(c)

运行很慢,执行计划说:“此查询在断开连接的模式之间构建笛卡尔积”

所有的属性都被索引了,我试过了:

MATCH (c:TEST:LOC1) where c._text='P' with c
MATCH (a:TEST:LOC1),(b:TEST_JOIN:LOC1)
WHERE a._out = b._in and b._out = c._in
CREATE (a)-[r:TEST_JOIN]->(c)

抱歉,如果这是基本的。有谁知道如何优化这个?非常感谢。

最佳答案

我会试试这个

MATCH (c:TEST:LOC1) where c._text='P' with c
MATCH (b:TEST_JOIN:LOC1) where b._out = c._in with b, c
Match (a:Test:LOC1) WHERE a._out = b._in with a, c
CREATE (a)-[r:TEST_JOIN]->(c)

关于neo4j - 多个neo4j节点加入: "This query builds a cartesian product between disconnected patterns",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35928989/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com