没有Using关键字,Neo4j索引无法正常工作

时间:2014-10-12 21:31:30

标签: neo4j neo4jclient

如果我执行此查询

match (p:Person),(c:Customer) using index p:Person(BusinessEntityID)  where p.BusinessEntityID = c.CustomerID return p

响应非常快。 如果我删除using关键字并执行此操作。

match (p:Person),(c:Customer)  where p.BusinessEntityID = c.CustomerID return p

,查询将永远返回结果。我有大约50,000个节点。 此外,.Net客户端没有实现使用索引,我基本上卡住了。 你能帮忙我如何加快查询速度。

注意:我在标签上的BusinessEntityID和CustomerID上都创建了索引:Person和:Customer。

1 个答案:

答案 0 :(得分:0)

  1. 也许您应该在两者之间建立关系,而不是在属性上进行手动连接?
  2. 然后,请将其更改为:

    match (c:Customer)
    match (p:Person)
    where p.BusinessEntityID = c.CustomerID 
    return p