Does the embedded map / abbreviation on Mongo block contain?
In inline mode, the output is returned as a single document essentially limiting the maximum document size, so can you see a difference in behavior or response times because you are returning a larger result?
In terms of blocking, the Map / Reduce job can be thought of as many small operations (including writes).
- It reads from the collection (read lock gave every 100 documents)
- Inserts documents into a temporary collection (write lock for one record)
- It creates the final collection or merges or replaces an existing collection (write lock)
Your built-in mode removes the second second by having it as a memory stick, so you shouldn't see write locks, at least not for this job. Could the locks be due to JS operations, or read rather than write perhaps?
source to share