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

Explore bounding clustered collection scans more tightly

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.3.0
    • None
    • None
    • Fully Compatible
    • Execution Team 2022-01-10, Execution Team 2022-01-24, Execution Team 2022-02-07, Execution Team 2022-02-21

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: