提高cypher语句执行效率
2016-04-16 19:53
183 查看
尽量使用参数
这是因为cypher的缓存机制,相同的query执行第二遍会快很多
避免笛卡尔积
笛卡尔积会让执行时间爆炸式的增长
在写上上述笛卡尔积式时,请一定确保用where过滤过了
下面也是一种情况
避免在where语句中做匹配
可以换成这样来写
拆分较长的match语句
stackoverflow…
这是因为cypher的缓存机制,相同的query执行第二遍会快很多
避免笛卡尔积
笛卡尔积会让执行时间爆炸式的增长
match (a),(b) return *
在写上上述笛卡尔积式时,请一定确保用where过滤过了
下面也是一种情况
match (u:user)-[:purchase]->(i:item) where ... with u, i match (foo)-[:relate]->(bar) return *
避免在where语句中做匹配
match (u:user)-[:viewed]->(i:item),(u)-[:purchase]->(other:item) where u.id=123123 and (i)-[:related_to]->(other) return i
可以换成这样来写
match (u:user)-[:viewed]->(i:item),(u)-[:purchase]->(other:item) where u.id=123123 with i,other match (i)-[related_to]->(other) return i
拆分较长的match语句
stackoverflow…
相关文章推荐
- 算法导论 思考题 2-1
- oc
- c++ 一个构造函数 调用 另一个 构造函数
- XenServer安全重启xapi的方法
- Hadoop 统计日志文件小案例
- node初识
- 程序员的自我提升
- Android中DialogFragment的使用
- SGU 152 Making round(水~)
- 虚幻引擎4的基于物理模型光照
- c++大数模板
- xenserver VM假死
- 使用substance包优化java界面
- lintcode 之 最长公共子串
- Webpack教程二
- 设计模式:桥接模式(Bridge)
- iOS JSPatch
- 是你教会了我-如何爱
- UVA 11082 Matrix Decompressing(网络流)
- Webpack教程二