Fixes #131
This PR moves the shortest path function to a materialized CTE as described in the issue above. A quick benchmark:
FROM GRAPH_TABLE (snb
MATCH o = ANY SHORTEST (p:Person where p.firstName = 'John')-[k:knows]-> *(p2:Person)
COLUMNS(element_id(o), path_length(o), vertices(o), edges(o)));
main -- a4cd66bcbd957705c565ab354a2346bee9ac4fbe:
Run Time (s): real 547.356 user 518.047915 sys 24.484855
This PR -- 944ac096aa7c14c8f1564b98577d7ed3f28ab145
Run Time (s): real 111.225 user 104.965922 sys 4.298592
This is the best case possible where all four functions are called. In the old way, the shortest path function was executed four times. Now it will only be called once and the results are materialized.
Performance will be the same if the query only calls the function once.
Fixes #131 This PR moves the shortest path function to a materialized CTE as described in the issue above. A quick benchmark:
main -- a4cd66bcbd957705c565ab354a2346bee9ac4fbe: Run Time (s): real 547.356 user 518.047915 sys 24.484855
This PR -- 944ac096aa7c14c8f1564b98577d7ed3f28ab145 Run Time (s): real 111.225 user 104.965922 sys 4.298592
This is the best case possible where all four functions are called. In the old way, the shortest path function was executed four times. Now it will only be called once and the results are materialized.
Performance will be the same if the query only calls the function once.