我對過濾時密碼查詢的優化有疑問。 實體和地址節點之間存在關係。這裏有兩個查詢 -哪個更好的方法來過濾密碼查詢
match(a:Address)<-[r]-(e:Entity) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
match(e:Entity)-[r]->(a:Address) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
這些以上兩個查詢哪個更好?
我對過濾時密碼查詢的優化有疑問。 實體和地址節點之間存在關係。這裏有兩個查詢 -哪個更好的方法來過濾密碼查詢
match(a:Address)<-[r]-(e:Entity) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
match(e:Entity)-[r]->(a:Address) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
這些以上兩個查詢哪個更好?
使用命令
profile match(a:Address)<-[r]-(e:Entity) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
profile match(e:Entity)-[r]->(a:Address) where a.addressLocation=~".*(?i)ABC XYZ.*" return r
要看看是否有你的新版本任何區別在這兩個查詢。 此外,我建議,如果你知道有一個與creteria a.addressLocation=~".*(?i)ABC XYZ.*"
少數地址嘗試使用查詢像
match(a:Address) where a.addressLocation=~".*(?i)ABC XYZ.*"
with a Match (a)<-[r]-(e:Entity) return r
要了解更多關於這裏介紹一下http://neo4j.com/docs/stable/execution-plans.html
謝謝,我會看看如果這可以幫助。 – RCS