At the end of Chapter 3 Lecture 2, Norberto imports 1,000,000 records into the norberto_friends collection with profiling enabled with (2,0). He then queries for a non-indexed key (city:“Barcelona”) and then checks the profiler with
…and finds that the “millis” field shows 0 milliseconds (wrapping to the beginning of Lecture 3). After this, he disables profiling by resetting to the default value of (0,100) and again issues the city:“Barcelona” find() query with the added explain executionStats:
We can then see that the executionTimeMillis value is 356 milliseconds. So…why would the explain show 356 milliseconds while the profiler would show 0? There is no explaination given by Norberto, and in fact it is claimed that showing the explain output should clear up the confusion of the profiler showing 0, however it only adds to it.
Does anyone know how these could be so vastly different in measuring the query execution time?