mongodb - Mongodb查询解释opterationTime的含义?
问题描述
我们想找出常规字符串比较与正则表达式比较之间的性能差异。需要关于“操作时间”的进一步理解/解释。
任何人都可以解释“操作时间”的含义吗?
"operationTime" : Timestamp(1573768915, 16291) // 需要 16.291 毫秒?"operationTime" : Timestamp(1573768904, 15024) // 需要 15.024 毫秒?
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",
"indexFilterSet" : false,
"parsedQuery" : {
"accountId" : {
"$regex" : "^abcdefg$"
}
},
"winningPlan" : {
"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",
"filter" : {
"accountId" : {
"$regex" : "^abcdefg$"
}
},
"indexName" : "accountId_partnerId",
"isMultiKey" : false,
"isUnique" : true,
"isSparse" : false,
"isPartial" : true,
"indexVersion" : 2.0,
"direction" : "forward",
"indexBounds" : {
"accountId" : [
"[\"abcdefg\", \"abcdef:\")",
"[/^abcdefg$/, /^abcdefg$/]"
],
"partnerId" : [
"[MinKey, MaxKey]"
]
}
}
},
},
"serverInfo" : {
"host" : "mongodb-delta-02",
"port" : 27017.0,
"version" : "3.6.10",
"gitVersion" : "3e3ab85bfb98875af3bc6e74eeb945b0719f69c8"
},
"ok" : 1.0,
**"operationTime" : Timestamp(1573768904, 15024),**
"$clusterTime" : {
"clusterTime" : Timestamp(1573768904, 15024)
}
}```
解决方案
请务必阅读回复部分。整个描述将帮助您理解“响应字段”。
https://docs.mongodb.com/manual/reference/method/db.runCommand/index.html#response
推荐阅读
- python - 变量的回调?
- python - 将 Sklearn 模型保存为 h5 文件
- php - 使用连接从单个查询中获取嵌套数组
- android - 内核与 Android 之间的通信,Juno Board 中的通知消息
- git - 无法从 Gitlab 中删除陈旧的分支?
- php - 使用 str_replace 替换两个包含新添加文本的字符串
- java - 扫描 Hbase where 两个值之间的列
- c# - 无法加载类型 FormFile 的问题但解决方案构建良好发生在迁移时
- python - SimPy 中的接收器状态
- java - 当我试图在 springboot 中从 Mysql 数据库中获取数据时,我收到以下错误“给定的 id 不能为空”