We see very slow performance for some of our queries that returns lots of results (100ks to 1Ms of rows). Analyzing the PROFILE it seems that the consumption of the results is what is eating up the time and not the querying itself. We tried reducing the overhead of data being returned by doing a collection of the property that returns in one row vs millions of rows of one property. However, this approach has limitations and wandering if there is any insight on what else can be done. The following is a general representation of the query. The pattern match does not seem to be the bottleneck and the availability only increases slightly in version 2 since we encapsulated in collect() aggregation.
Neo4j Version: 3.5
Is there any improvement on the transfer/consumption of results in 4.X or is that primarily a bandwidth and driver issue?
Basic Return Version:
Query: MATCH (a:Label1)-[:relation*]->(b:Label2) RETURN b.Property as result
Available: 13s
Consumed: 189.5s
Screenshot of Actual PROFILE
Collection Return Version:
Query: MATCH (a:Label1)-[:relation*]->(b:Label2) RETURN collect(b.Property) as result
Available: 17s
Consumed: 0.15s
Screenshot of Actual PROFILE