indexBasedCE: Location9274202 "X must be <= X to produce selectivity" with large collection, inequality

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      With collection sizes >10K , inequalities and $nor, that is, things that produce two index ranges result in an error:

      db.foo.drop();
      docs = [];
      for (let i = 1; i <= 10000; i++) {
      	docs.push({a:i});
      }
      
      db.foo.insertMany(docs);
      db.foo.createIndex({a:1});
      db.foo.find({"a":{"$ne":17}});
      MongoServerError[Location9274202]: 10000 must be <= 10000 to produce selectivity
      

      Another statement that produced the same error from a different dataset:

      Enterprise test> db.plan_stability.aggregate([{"$match":{"$nor":[{"i_idx":{"$eq":16}}]}}])
      MongoServerError[Location9274202]: 100000 must be <= 100000 to produce selectivity
      

            Assignee:
            Hana Pearlman
            Reporter:
            Philip Stoev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: