Mongodb查询解释opterationTime的含义?

我们想找到常规字符串比较与regex比较之间的性能差异。需要进一步了解/解释“ operationTime”。

任何人都可以解释“ operationTime”的含义吗?

“ operationTime”:Timestamp(1573768915,16291)//花费16.291ms吗? “ operationTime”:Timestamp(1573768904,15024)//花费15.024ms吗?

db.getcollection("customer").find({accountId: "abcdefg"}).explain()
{ 
    "queryPlanner" : {
        "plannerVersion" : 1.0,"namespace" : "myserver.customer","indexFilterSet" : false,"parsedQuery" : {
            "accountId" : {
                "$eq" : "abcdefg"
            }
        },"winningPlan" : {
            "stage" : "FETCH","inputStage" : {
                "stage" : "IXSCAN","indexName" : "accountId_partnerId","isMultiKey" : false,"multiKeyPaths" : {
                },"isUnique" : true,"issparse" : false,"isPartial" : true,"indexVersion" : 2.0,"direction" : "forward","indexBounds" : {
                    "accountId" : [
                        "[\"abcdefg\",\"abcdefg\"]"
                    ],"partnerId" : [
                        "[MinKey,MaxKey]"
                    ]
                }
            }
        },},"serverInfo" : {
        "host" : "mongodb-delta-02","port" : 27017.0,"version" : "3.6.10","gitVersion" : "3e3ab85bfb98875af3bc6e74eeb945b0719f69c8"
    },"ok" : 1.0,**"operationTime" : Timestamp(1573768915,16291),**
    "$clusterTime" : {
        "clusterTime" : Timestamp(1573768915,16291)
    }
}

db.getcollection("customer").find({accountId: /^abcdefg$/}).explain()
{ 
    "queryPlanner" : {
        "plannerVersion" : 1.0,"namespace" : "myserver-customer","parsedQuery" : {
            "accountId" : {
                "$regex" : "^abcdefg$"
            }
        },"filter" : {
                    "accountId" : {
                        "$regex" : "^abcdefg$"
                    }
                },\"abcdef:\")","[/^abcdefg$/,/^abcdefg$/]"
                    ],**"operationTime" : Timestamp(1573768904,15024),**
    "$clusterTime" : {
        "clusterTime" : Timestamp(1573768904,15024)
    }
}```
zhaojiejie 回答:Mongodb查询解释opterationTime的含义?

请务必阅读回复部分。整个描述将帮助您理解“响应字段”。

https://docs.mongodb.com/manual/reference/method/db.runCommand/index.html#response

本文链接:https://www.f2er.com/3098458.html

大家都在问