什么是mongo $ mergeCursors?

时间:2015-06-05 15:13:18

标签: mongodb aggregation-framework

我们在mongo日志中看到很多慢查询,如下所示(使用管道操作opCug合并)。我们有一个带有2个碎片的阴影蒙古,只有原色。什么是mergeCursors命令?如果需要任何其他信息,请告诉我。

{
    "_id" : ObjectId("5571b739f65f7e64bb806362"),
    "op" : "command",
    "ns" : "mongrel.$cmd",
    "command" : {
        "aggregate" : "collection1",
        "pipeline" : [ 
            {
                "$mergeCursors" : [ 
                    {
                        "host" : "endpoint:27005",
                        "id" : NumberLong(82775337156)
                    }
                ]
            }
        ]
    },
    "keyUpdates" : 0,
    "numYield" : 0,
    "lockStats" : {
        "timeLockedMicros" : {
            "r" : NumberLong(12),
            "w" : NumberLong(0)
        },
        "timeAcquiringMicros" : {
            "r" : NumberLong(2),
            "w" : NumberLong(2680)
        }
    },
    "responseLength" : 12312,
    "millis" : 6142,
    "execStats" : {},
    "ts" : ISODate("2015-06-05T12:35:40.801Z"),
    "client" : "10.167.212.83",
    "allUsers" : [],
    "user" : ""
}

1 个答案:

答案 0 :(得分:1)

我最近正在阅读这篇文章(http://dbattish.tumblr.com/post/108652372056/joins-in-mongodb),这似乎是说它是一个内部聚合命令,用于跨分片合并查询。