I have a tiny doubt about a question of the final exam^^
I do not know how to post it, so i’ll try to be as generic as possible (and feel free to remove the post as required if it violate any of the forum rules)^^
Because the $match stage did not come prior […] all source documents will pass through them, a wasteful computation
- Is the above statement correct?
Quoting from mongo docs ( Mongo docs - pipeline optimization ) :
If an aggregation pipeline contains multiple projection and/or
$matchstages, MongoDB performs this optimization for each
$matchstage, moving each
$matchfilter before all projection stages that the filter does not depend on.
- Now, the following statement is related to the correct answer:
however the number should besmall enough
That’s was exactly my doubt: how much is enough? The situation that verifies in the correct answer is described as the devil on earth in other parts of the course (and other courses), but if it applies to a small enough dataset is fine.
What i want to point out is: aren’t those two described situation a bit too much ‘close’ ? (by close i mean heavily dependant on the dataset size, which is not provided as handout).
Finally, i want to thank you for all the work you’ve done and keep doing!