I check the manual because I got curious while conducting the explain(“executionStats”) test.
But I have a question because there is a slightly ambiguous sentence for me to understand.
MongoDB runs the query optimizer to choose the winning plan, executes the winning plan to completion, and returns statistics describing the execution of the winning plan.
Does this sentence mean that you actually run the query (not sample) using the winning plan selected by the optimizer and show the statistics of the results?
If I’m running a real query, then .explain(“executionStats”) will use the same amount of resources as when I run the query.