Performace in $lookup stage

Hello Team,

How can I optimise queries and performance of my distributed system when using $lookup stage in the aggregation pipeline.

Hi,

Have flagged this to discuss with the team. I know the query optimizer performs some optimizations when $lookup is followed by $unwind, but do not know if it can be improved in any other ways.

https://docs.mongodb.com/manual/core/aggregation-pipeline-optimization/#lookup-unwind-coalescence

José Carlos

Hey there!

Could you share a bit of psuedo-code for what you are doing with $lookup? It might be easier to say “change this slightly” than list of 99 things that aren’t applicable to you at the very moment.