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

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

    • Query Optimization
    • Query 2017-08-21

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            4 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: