Neo4j密码在中心节点上通过REST的查询性能 [英] Neo4j cypher query performance via REST on centered nodes

查看:48
本文介绍了Neo4j密码在中心节点上通过REST的查询性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还是neo4j的新手.我编写了一个小的RESTFUL服务,该服务通过REST作为PoC将节点插入到neo4j db(服务器)中.结构看起来是这样的:根-[节点]-> n-> [节点]->节点

I'm still pretty new to neo4j. I've written a small RESTFUL service which inserts nodes to a neo4j db (server) via REST as a PoC. The structure looks this way: root - [NODES] -> n -> [NODE] -> node

第n个节点是居中"的节点.我计划将其他居中的节点添加为不同的节点类型(例如,产品/类别/文档/属性/用户...)

The n node is the one that is "centered". I planned to add other centered node as different node types (e.g. products/categories/documents/attributes/users ...)

在我的第一个示例中,我添加了大约. 1.000个节点.现在,我尝试增加节点的数量并查询该节点.现在,我面临一种性能问题".那是我的查询,在neo4j(1.6.1)Web控制台上执行

In my first example i added approx. 1.000 nodes. Now i tried to increase the aount of nodes and query for that nodes. Now i'm facing a kind of performance "problems". That are my queries, executed at the neo4j (1.6.1) web console

开始x = node(0)匹配路径=(x-[:NODES]->居中-[:NODE]->节点)返回节点ORDER BY node.id LIMIT 10

START x = node(0) MATCH PATH = (x - [:NODES] -> centered - [:NODE] -> node) return node ORDER BY node.id LIMIT 10

开始x =节点(0)匹配路径=(x-[:NODES]->居中-[:NODE]->节点)返回计数(*)

START x = node(0) MATCH PATH = (x - [:NODES] -> centered - [:NODE] -> node) return count(*)

我需要分页查询.第一个应该选择要显示的元素,第二个要计算页面.

I need the queries for pagination. The first one should select the elements to be shown and the second one to calculate the pages.

查询时间: 1.000个节点:〜120ms 4.000个节点:〜200-300ms 6.000个节点:〜250-500ms

Query times: 1.000 nodes: ~120ms 4.000 nodes: ~200 - 300ms 6.000 nodes: ~250 - 500ms

密码查询时间正在快速增加(我认为).我计划以这种方式添加〜2.000.000节点.查询是否有问题?有可能使它们更快吗? (我已经将neo4j堆大小设置为100M,对于1万个节点应该没问题)

The cypher query time is increasing very fast (in my opinion). I planned to add ~2.000.000 nodes in that way.Is there anything wrong with my queries? Is it possible to get them faster? (I already setted up my neo4j heap size to 100M, what should be ok for 10k nodes)

提前谢谢!

推荐答案

您可以做的第一件事是删除路径分配-您没有使用路径PATH,因此无需创建路径.

The first thing you can do is to remove the path assignment - you are not using the path PATH, so there's no need to create it.

除此之外,您似乎在这里没有做错任何事情.

Other than that, you don't seem to be doing anything wrong here.

在1.7上,这种查询的密码性能要好于1.6.昨天我们发布了1.7.M03,如果您不将其限制在1.6,则可以试一下.

Cypher performance for this type of query is much better on 1.7 than 1.6. We released 1.7.M03 yesterday, you can take that out for a spin, if you are not tied down to 1.6.

这篇关于Neo4j密码在中心节点上通过REST的查询性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆