我们想找到常规字符串比较与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)
}
}```