[DOCS-10779] please make it easier to understand whether a query is index only Created: 12/Sep/17  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Minor - P4
Reporter: Mark Callaghan Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

AFAIK, back in the day db.find().explain() had an "indexOnly" attribute. That has been removed and now I am confused by the text for "Covered Queries" in https://docs.mongodb.com/manual/reference/explain-results/

An example would help.

Below is explain output for a query that it isn't index-only but that took me too long to figure out.

{
        "queryPlanner" : {
                "plannerVersion" : 1,
                "namespace" : "ib.pi1",
                "indexFilterSet" : false,
                "parsedQuery" : {
                        "customerid" : {
                                "$lt" : 0
                        }
                },
                "winningPlan" : {
                        "stage" : "PROJECTION",
                        "transformBy" : {
                                "_id" : -1,
                                "price" : 1,
                                "customerid" : 1
                        },
                        "inputStage" : {
                                "stage" : "FETCH",
                                "filter" : {
                                        "customerid" : {
                                                "$lt" : 0
                                        }
                                },
                                "inputStage" : {
                                        "stage" : "IXSCAN",
                                        "keyPattern" : {
                                                "price" : 1,
                                                "customerid" : 1
                                        },
                                        "indexName" : "pc",
                                        "isMultiKey" : false,
                                        "multiKeyPaths" : {
                                                "price" : [ ],
                                                "customerid" : [ ]
                                        },
                                        "isUnique" : false,
                                        "isSparse" : false,
                                        "isPartial" : false,
                                        "indexVersion" : 2,
                                        "direction" : "forward",
                                        "indexBounds" : {
                                                "price" : [
                                                        "[MinKey, MaxKey]"
                                                ],
                                                "customerid" : [
                                                        "[MinKey, MaxKey]"
                                                ]
                                        }
                                }
                        }
                },
                "rejectedPlans" : [ ]
        },
        "serverInfo" : {
                "host" : "nuc1",
                "port" : 27017,
                "version" : "3.4.6-1.7",
                "gitVersion" : "74b930309498503ee1c64d9a2526e45e2da464a2"
        },
        "ok" : 1
}



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 08:01:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.