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
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 ...)
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
START x = node(0) MATCH PATH = (x - [:NODES] -> centered - [:NODE] -> node) return node ORDER BY node.id LIMIT 10
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.
Query times: 1.000 nodes: ~120ms 4.000 nodes: ~200 - 300ms 6.000 nodes: ~250 - 500ms
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)
Thanks in advance!