【发布时间】:2015-08-14 17:15:33
【问题描述】:
我正在迁移标记节点中的一些属性,查询性能很差。
旧属性是 callerRef,新属性是 code。有 17m 节点需要更新,我想批量处理。实体上没有 code 属性表示它尚未升级。
profile match (e:Entity) where not has(e.code) with e limit 1000000 set e.key = e.callerKeyRef, e.code = e.callerRef;
实体标签中有一个索引,用于代码。
schema -l :Entity
Indexes
ON :Entity(code) ONLINE
No constraints
堆分配了 8gbs 运行 Neo4j 2.2.4。如果我正确地阅读了计划,问题是即使指定了限制子句,标签中的所有节点都被命中。我原以为在请求限制的无序查询中,在满足限制条件后处理将停止。
+-------------------+
| No data returned. |
+-------------------+
Properties set: 2000000
870891 ms
Compiler CYPHER 2.2
+-------------+----------+----------+-------------+--------------------------+
| Operator | Rows | DbHits | Identifiers | Other |
+-------------+----------+----------+-------------+--------------------------+
| EmptyResult | 0 | 0 | | |
| UpdateGraph | 1000000 | 6000000 | e | PropertySet; PropertySet |
| Eager | 1000000 | 0 | e | |
| Slice | 1000000 | 0 | e | { AUTOINT0} |
| Filter | 1000000 | 16990200 | e | NOT(hasProp(e.code)) |
| NodeByLabel | 16990200 | 16990201 | e | :Entity |
+-------------+----------+----------+-------------+--------------------------+
Total database accesses: 39980401
我是否遗漏了一些明显的东西? TIA
【问题讨论】:
-
blog.bruggen.com/2015/07/… 有/没有使用直到 2.3 才支持的索引中的列,所以没有可用的优化?