Explain Result "saveState" : 4452, "restoreState" : 4452,

272 views
Skip to first unread message

Rohit Jain

unread,
Sep 25, 2015, 4:43:23 PM9/25/15
to mongodb-user
Hi,
  I have a query explain result which contains saveState and restoreState. Can someone expalin me the specification of above two ?

Thanks in Advance,
Rohit

Stephen Steneker

unread,
Sep 26, 2015, 8:38:38 PM9/26/15
to mongodb-user

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

Reply all
Reply to author
Forward
0 new messages