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

Using $min and $max on shard key doesn't target queries

    XMLWordPrintable

Details

    • Query 2017-08-21

    Description

      Using $gte and $lt on the shard key fields inside a query will cause it the query to be targeted to only the appropriate shards.

      However, using the $min and $max query operators (while hinting on the shard key) doesn't target the query to the relevant shard(s) in the same way. The explain() is missing indexBounds in this case, which may be the cause or at least related?

      I also tested 2.4.10 and 2.7.2 and the issue is present both.

      Attachments

        Issue Links

          Activity

            People

              backlog-query-optimization Backlog - Query Optimization
              kevin.pulo@mongodb.com Kevin Pulo
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: