Reima Terest
Reima Terest

Reputation: 1

Neo4j - How can I improve query execution time (server consumption)?

I use a Neo4j database (access via docker) with 177,000,000 nodes and 352,000,000 relationships. This is a sample query I want to improve:

MATCH (a:NodeA {prop1: $prop1})<-[:BA]-(b:NodeB)-[:BC]->(c:NodeC)-[:CD]->(d:NodeD)-[:DE]->(e:NodeE)
RETURN e.prop2, a.prop1, a.prop3, c.prop4, c.prop5, b.prop6;

There is an index on prop1.

I used the python v1 driver to measure query execution times. There are two different times in the ResultSummary:

My queries have short 'available' times (1 to 80 ms) but very large 'consumption' times (up to 350000 ms).

I tried to optimize the queries by using parameters and I changed some memory configuration (increased page cache size and reduced heap size) and that leaded to shorter 'available' times (1 to 15 ms) and also shorter 'consumption' times (20000 to 250000 ms). Unfortunately, the consumption time is still very high!

My questions:

Thank you, Reima

Upvotes: 0

Views: 333

Answers (1)

Swapnil
Swapnil

Reputation: 131

To answer your first question I guess the response is streamed so available time is when the first record arrives and consumption time is when the complete result set has been received and processed , somewhat time difference between last record received and first record received. My apologies if my assumption turn out to be wrong. To answer your second question keep as much data in memory cache as possible or use SSD if high RAM is not an option.Following link may be of help.

1) Linux file system tuning

2) Memory tuning

3) Disk and ram considerations

Upvotes: 1

Related Questions