Reputation: 85
I'm executing a simple query in neo4j which is taking around 5s in the first attempt and then around 100ms in next tries. The query is :
match (n:user{phone:'224'})-[:knows]->
(m:user{phone:'1234'}) return count(m);
total nodes : 80002 of label user
relationships : around 80 Million nodes
Index on :user(phone)
Query execution plan is also using phone index as its first step.
Is the data large enough to justify 5s query time or there is some performance tuning which I can use for the server.
Upvotes: 0
Views: 168
Reputation: 39905
I assume your first execution of that query is on a cold cache. Subsequent invocation benefit from accessing nodes and relationships from the cache instead of fetching them form your IO subsystem. For details look at the reference manual.
A common best practice is to warm up caches after server startup.
Upvotes: 2