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

MongoS does not re-write $in queries which results in all terms in $in array being sent to all shards

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Sharding
    • None

    Description

      In sharded environment, a query like
      {_id : {$in : [100, 200, 300, 400, 500, 600...]}}
      needs to be re-written by mongos by first resolving each _id value to the shard based on shard key (provided the shard key can be deduced from the query) and then sending corresponding sub-qery to the right shard.
      Example, if 100, 300, 500 belong to shard1 and 200, 400, 600 belong to shard2 MongoS needs to make exactly 2 queries:
      {_id : {$in : [100, 300, 500]}}
      to shard1
      and
      {_id : {$in : [200, 400, 600]}}
      to shard2.

      Attachments

        Activity

          People

            Unassigned Unassigned
            antoine Antoine Girbal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: