In the current implementation of the plan shape counters, we increment for each query to the foreign collection when a $lookup is executed in classic. Our intention was to only increment them for the local side, this fixes the issue by first checking some data on the canonicalQuery about if we're in a $lookup or a subpipeline
The counters are incremented for every query to the foreign collection, which has caused minor perf regressions