问题描述
我尝试使用包含25000行的csv文件导入关系数据,然后使用此密码:
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line
MATCH (a:user{value:line.userId}),(b:device{value:line.deviceId})
MERGE (a)-[rel:myrelname]->(b)
WITH rel,COALESCE(rel.eventOccurTime,[]) + line.eventOccurTime AS eventOccurTime
UNWIND eventOccurTime as r0
WITH rel,collect(distinct r0) AS unique
set rel.eventOccurTime= unique,rel.business_name='data-test'
30分钟后,出现此错误: [Neo.DatabaseError.Statement.ExecutionFailed]:连接重置,参考0b8a3600-d715-44bf-8c5b-4260edeab459。
我该如何解决?
解决方法
一些尝试:
-
简化(并加快)查询。无需放松,然后重新收集列表的不同元素。除非确实必要,否则无需创建临时列表或将其追加到列表中。
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line MATCH (a:user{value: line.userId}),(b:device{value: line.deviceId}) MERGE (a)-[rel:myrelname]->(b) SET rel.business_name='data-test',rel.eventOccurTime = CASE WHEN rel.eventOccurTime IS NULL THEN [line.eventOccurTime] WHEN line.eventOccurTime IN rel.eventOccurTime THEN rel.eventOccurTime ELSE rel.eventOccurTime + line.eventOccurTime END
-
您可能希望通过在以下位置创建indexes来提高性能:
-
:user(value)
-
:device(value)
-
-
使用PROFILE分析从您的Cypher生成的执行计划。