在分析 Mongo 查询时,"millis" 是什么意思?
When profiling a Mongo query, what does "millis" mean?
我们正在开发一个应用程序,其中 Java 代码与 Mongo 对话并使用 Spring 数据流式传输结果。我们一直在查看探查器输出,但我不是 100% 了解它的含义。
https://docs.mongodb.com/manual/reference/database-profiler/
{
"op" : "query",
"ns" : "test.c",
"query" : {
"find" : "c",
"filter" : {
"a" : 1
}
},
"keysExamined" : 2,
"docsExamined" : 2,
"cursorExhausted" : true,
...
"responseLength" : 108,
"millis" : 0,
文档的描述是:
system.profile.millis
The time in milliseconds from the perspective of the mongod from the beginning of the operation to the end of the operation.
好的,但是操作是什么?如果我正在执行查询并且我正在拉回 1000 个结果,那么 "millis" 时间是否仅用于查询计划?或者它是否包括它用于拉回结果并将它们发送给驱动程序的整个过程?
这会在流媒体和非流媒体时给出不同的答案吗?
操作是查询;该查询没有 return 个文档,而是 return 个指向磁盘上文档位置的游标:
https://docs.mongodb.com/v3.0/core/cursors/
"millis"结果是MongoDB搜索查询结果所花费的时间(执行索引或集合扫描,识别所有满足查询条件的文档并在必要时执行排序)和return对应光标到驱动程序。
我不确定你所说的 "streaming" 是什么意思,但它可能是驱动程序迭代游标以访问查询结果。
我们正在开发一个应用程序,其中 Java 代码与 Mongo 对话并使用 Spring 数据流式传输结果。我们一直在查看探查器输出,但我不是 100% 了解它的含义。
https://docs.mongodb.com/manual/reference/database-profiler/
{
"op" : "query",
"ns" : "test.c",
"query" : {
"find" : "c",
"filter" : {
"a" : 1
}
},
"keysExamined" : 2,
"docsExamined" : 2,
"cursorExhausted" : true,
...
"responseLength" : 108,
"millis" : 0,
文档的描述是:
system.profile.millis The time in milliseconds from the perspective of the mongod from the beginning of the operation to the end of the operation.
好的,但是操作是什么?如果我正在执行查询并且我正在拉回 1000 个结果,那么 "millis" 时间是否仅用于查询计划?或者它是否包括它用于拉回结果并将它们发送给驱动程序的整个过程?
这会在流媒体和非流媒体时给出不同的答案吗?
操作是查询;该查询没有 return 个文档,而是 return 个指向磁盘上文档位置的游标: https://docs.mongodb.com/v3.0/core/cursors/
"millis"结果是MongoDB搜索查询结果所花费的时间(执行索引或集合扫描,识别所有满足查询条件的文档并在必要时执行排序)和return对应光标到驱动程序。
我不确定你所说的 "streaming" 是什么意思,但它可能是驱动程序迭代游标以访问查询结果。