SERVER-136925ClosedWon't Do
Bound the join plan cache trial window by the query's limit
The join plan cache measures its baseline (and, on a cache hit, runs its trial) over a fixed window of {{internalQueryJoinPlanCacheTrialWindow}} documents (default 101), independent of how many documents the query can actually return. When the query has a limit smaller than the window, the trial runs and buffers more than it needs. This increases the latency to first result in the case of limits. We should investigate using {{min(limit, internalQueryJoinPlanCacheTrialWindow)}} (mirroring the