Query variable scalability and performance

Cascade is a relatively low cost operation that happens towards the end of processing of a sub-query. It simply drops some of the nodes that were part of query result that didn’t have a predicate which was there in the query. So using a Cascade shouldn’t affect the performance of your query.
A Filter operation has cost of O(number of results) in that sub-query because we iterate over all results and filter out the ones that match the condition. So every new filter you add can will add a small cost to the query.

Feel free to ask if you have any further questions. Please do mark this as resolved if it answers your questions regarding performance of query.

2 Likes