Reputation: 31
I'm executing allShortestPaths
query in neo4j.After
a lot of tests, I have found that when executing the allShortestPaths
query for the first time, it takes about 2~3 seconds, but when executing the same query again, it always takes less than 500ms.
After studying the neo4j documentation, I have known it has the page cache system. In neo4j-operations-manual, it says "When Neo4j starts up, its page cache is empty and needs to warm up",
I am wondering how to warm up the page cache manually,and what's the mechanism of the page cache.
How to guarantee the first query execution cost is less than 500ms?
Total nodes : 0.16 Billion nodes
Total relationships : around 0.16 Million relationships
Index on :E(eid)
A sample of the query is as follow:
"MATCH (node1:E { eid:"a9c2f114-796f-4934-a2d0-04bb3345e1d2" }),(node2:E { eid:"01968dd2-1ed6-472d-82e9-be7701036b3b" }), p = allShortestPaths((node1)-[*]-(node2))
RETURN p LIMIT 25"
Upvotes: 1
Views: 991
Reputation: 30397
You may want to install the APOC Procedures library, it has all kinds of great and useful tools, including a warmup procedure.
Upvotes: 2