Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-61939

Explore bounding clustered collection scans more tightly

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Execution Team 2022-01-10, Execution Team 2022-01-24, Execution Team 2022-02-07, Execution Team 2022-02-21

      A range query using an index likeĀ find({a:{$lte:"yadda")}} generates tight bounds:

      				"indexBounds" : {
      					"a" : [
      						"[\"\", \"yadda\"]"
      					]
      

      By contrast, a range query by the cluster key likeĀ find({_id:{$lte:"yadda")}} generates only a single bound:

      		"winningPlan" : {
      			"stage" : "COLLSCAN",
      			"filter" : {
      				"_id" : {
      					"$lte" : "yadda"
      				}
      			},
      			"direction" : "forward",
      			"maxRecord" : "yadda"
      		},
      

      This range query can be quite inefficient as it fetches any document of lower data type, like numeric types.

            Assignee:
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Reporter:
            josef.ahmad@mongodb.com Josef Ahmad
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: