neo4j查询性能加速

时间:2016-06-23 15:53:23

标签: neo4j

Neo4J 3.0.3 / Windows Server 2012R2 / Java" 1.8.0_91"

模型1

Nodes
  Provider  {provSysId:21, specialty:"CHIROPRACTIC", state:"GA"}
  Member    {mbrSysId:1234, gender:"M", age:"60-64"}

Relationships
  (:Member)-[:VISITED {etg:89898989, servDt:15985, etgBaseCls:32123, mpc:"08"}]-(:Provider)

大小:258,109个节点; 189,4871关系; 8,353,811房产

:Member(mbrSysId):Provider(provSysId):Provider(specialty):VISITED(etg):VISITED(servDt):VISITED(mpc)

的索引

查询

MATCH (p1:Provider)<-[v1:VISITED]-(m:Member)-[v2:VISITED]->(p2:Provider)
WHERE v1.mpc='08' and v1.etg=v2.etg and p1.specialty<>p2.specialty and 
    p1.provSysId<p2.provSysId and abs(v1.servDt-v2.servDt)<=365
WITH p1, p2, count(distinct m) as cnt
WHERE cnt>5
RETURN p1.provSysId, p2.provSysId, cnt;

在~80秒内运行

模型2 (使用@stdob中的建议发布在下面的评论中)

Nodes
  Provider  {provSysId:33, specialty:"CHIROPRACTIC", state:"GA"}
  Etg    {epsdId:666666, mbrSysId:99999999, basCls:"Some base class", mpc:"Orthopedics"}

Relationships
    (:Provider)-[:TREATED {servDt:15985}]-(:Etg)

大小:512,102个节点,1,894,871个关系,3,890,381个属性

:Provider(provSysId):Provider(specialty):Provider(state):Etg(epsdId):Etg(mbrSysId):Etg(basCls):Etg(mpc),{{1}的索引}}

为新模型修改了相同的查询

:TREATED(servDt)

在〜40秒内运行。

显然好多了。我正在寻找有关加速的任何其他建议。

0 个答案:

没有答案