mongodb keep_mutation stage explain

时光怂恿深爱的人放手 提交于 2019-12-01 06:54:14

问题


I use mongo's explain() to check the performance of some queries, sometimes a keep_mutation stage will show up like the following:

  "executionStats" : {
            ...
            "executionStages" : {
                    "stage" : "KEEP_MUTATIONS",
                    "nReturned" : 1,
                    "executionTimeMillisEstimate" : 5460,
                    "works" : 79622,
                    ...
            }
   }

I want to know more about this stage so I search through the internet, and to my surprise, I couldn't find useful info related to it even in the official document, let alone other websites. Could someone help to explain that?


回答1:


KeepMutationsStage passes all of its child's data through until the child is EOF. It then returns all flagged elements in the WorkingSet that pass the stage's filter.

This stage is used to merge results that are invalidated mid-query back into the query results when possible. The query planner is responsible for determining when it's valid to merge these results.

Source




回答2:


Check this :

KEEP_MUTATIONS stage: When documents are deleted or updated some Query stages can receive invalidation notices. Some stages flag documents that are deleted. The set of flagged documents is then read by the KEEP_MUTATIONS stage, which re-checks these documents against the query and returns them if they still match. Note that this is not used for the WiredTiger engine, only for the MMAPv1.



来源:https://stackoverflow.com/questions/33011166/mongodb-keep-mutation-stage-explain

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!