Hi all,
I’ve just watched the episode in question in the subject regarding slow queries.
At the beginning Norberto (The instructor) loads 10, 100, 1000 and a million records at last.
Until 1000 records, everything goes without incidents. However when he tries to filter by {$city: “Barcelona”}, he receives:
- 356 ms without index, full COLLSCAN
- Then he creates an index by $city and repeat the query, receiving 141ms (A “dramatic change” according to the video lesson, which it might be ok, less than hafl the time)
- Then he said that we can do better by projecting the query for only the name (“Way better” according to him) and receives 177ms!!!
So, how could that be possible? Payload was smaller but he received a full 30ms worst.
Most important, following the course he mentioned that every single query beyond 100ms is considered slow, so EVERY query shown in that lecture is way way deep into the “slow” world, with a mere million rows, which is a LOT for a local project but rather small for even a small sized company.
Is there an explanation about the lack of speed even with the index? Could it be that is just the vagrant run in a personal laptop? I have almost no experience benchmarking queries into a full dedicated server, hence my doubts.
Regards!