cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Profiling the query to reduce the execution time

Hi, Can someone help me in profiling the query below. I want to decrease the time it takes to execute.

Query: MATCH path=((a:Account {id:73})-[*3..5]-(a))
RETURN max(REDUCE(s = 0, r IN relationships(path) | s + r.baseAmount)) AS amt_max

3 REPLIES 3

Can you provide some sample data to help with this?

Also it looks like you're trying to find a path where (a) links back to itself, is that right?

A PROFILE plan would help (with all elements expanded)

(Account)-[transfers]->(Account) is the underlying schema.

I am trying to find the cyclic paths where the accounts involve in, along with the total amount which is being involved in the cycle. baseAmount is the property of the [transfers] relation.