I have a big doubt:
My pipeline begins with a match operator and continues with three unwind operators, there is another match, then a sort and limit and terminates with a projection.
Can I have a performance gain if I add an index on the key used to sort inside the pipeline? An if I add an index on the key used by the second match?
Thank you all,
I appreciate any comments or suggestions.
I am afraid that after the unwind no index can be used for the subsequent match and sort. The best would be to find a way to move the all the matches and sorts at the top of the pipeline. But it is not always possible.