Почему время выполнения MongoDB SQL в Navicat отличается от времени, показанного в функции объяснения ()? - PullRequest
0 голосов
/ 12 февраля 2020

MongoDB работает на сервере CentOS (7.5). Сначала я выполняю один SQL в Navicat, время выполнения составляет 6.991 с.

db.getCollection("analysis").find()
> OK
> 时间: 6.991s

Но когда я использую функцию объяснения () в MongoDB, для executeTimeMillis будет 0, как это.

db.getCollection("analysis").find().explain('executionStats')
> OK
> 时间: 0.038s
    "executionStats": {
        "executionSuccess": true,
        "nReturned": NumberInt("987"),
        "executionTimeMillis": NumberInt("0"),
        "totalKeysExamined": NumberInt("0"),
        "totalDocsExamined": NumberInt("987"),
        "executionStages": {
            "stage": "COLLSCAN",
            "nReturned": NumberInt("987"),
            "executionTimeMillisEstimate": NumberInt("0"),
            "works": NumberInt("989"),
            "advanced": NumberInt("987"),
            "needTime": NumberInt("1"),
            "needYield": NumberInt("0"),
            "saveState": NumberInt("7"),
            "restoreState": NumberInt("7"),
            "isEOF": NumberInt("1"),
            "invalidates": NumberInt("0"),
            "direction": "forward",
            "docsExamined": NumberInt("987")
        }
    },

В чем причина?

...