On Saturday, 26 September 2015 06:43:23 UTC+10, Rohit Jain wrote:
I have a query explain result which contains saveState and restoreState. Can someone expalin me the specification of above two ?
Hi Rohit,
In a MongoDB 3.0 explain, these are counters for the number of times a query stage yielded (saveState) and then resumed (restoreState). For example, a collection scan (COLLSCAN) stage might need to yield to fetch documents that aren’t in memory yet. Queries also yield so they can be interleaved with other queries and safely stopped via $maxTimeMS or kill operations.
I don’t think these are very interesting numbers on their own. If you run multiple successive explains of the same query you’ll notice the numbers change based on other operations at the time as well as whether all the required documents were in memory at the time.
I’ve raised a DOCS issue to have these added to the Explain Results page: https://jira.mongodb.org/browse/DOCS-6280.
Regards,
Stephen