我可以用“吗?”;使用“扫描…”;及;使用索引…“;在neo4j中的同一个密码查询中?
我正在阅读关于优化查询的文章,看到一篇文章说,有时cypher executor可能会错过使用索引,或者可能不会扫描所有标签而不是提供的标签,因此最好明确说明要使用哪个索引以及要扫描哪个标签。(这是我的理解) 所以当我尝试这样做时,它给了我这个错误我可以用“吗?”;使用“扫描…”;及;使用索引…“;在neo4j中的同一个密码查询中?,neo4j,cypher,Neo4j,Cypher,我正在阅读关于优化查询的文章,看到一篇文章说,有时cypher executor可能会错过使用索引,或者可能不会扫描所有标签而不是提供的标签,因此最好明确说明要使用哪个索引以及要扫描哪个标签。(这是我的理解) 所以当我尝试这样做时,它给了我这个错误 Neo.DatabaseError.Statement.ExecutionFailed: Failed to fulfil the hints of the query. Could not solve these hints: 'USING SCA
Neo.DatabaseError.Statement.ExecutionFailed: Failed to fulfil the hints of the query.
Could not solve these hints: 'USING SCAN (some node)'
我有这样一个问题:
MATCH (n:Label1)-[r:SOME_REL]->(n2:LABEL3)
其中n2
可以有:Label2
和:Label3
我无法运行这些查询:
MATCH (n:Label1{property:val})-[r:SOME_REL]->(n2:LABEL3)
USING INDEX n:Label1(property)
USING SCAN n2:Label3
RETURN n
MATCH (n:Label1{property:val})-[r:SOME_REL]->(n2:LABEL3)
USING SCAN n2:Label3
USING INDEX n:Label1(property)
RETURN n
匹配
模式只能使用索引(例如,:Label1(属性)
),如果它同时指定标签和属性值。例如,这将起作用:
MATCH (n:Label1 {property: 123})-[r:SOME_REL]->(n2:Label3)
USING INDEX n:Label1(property)
USING SCAN n2:Label3
RETURN n;
注意:如果同时指定标签和属性值,
匹配模式只能使用索引(例如,:Label1(属性)
),则此查询还对Label3使用一致的大小写。例如,这将起作用:
MATCH (n:Label1 {property: 123})-[r:SOME_REL]->(n2:Label3)
USING INDEX n:Label1(property)
USING SCAN n2:Label3
RETURN n;
注意:此查询还对Label3
使用一致的大小写