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

EXPRESS_IXSCAN, COUNT_SCAN not estimated and costed

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Query Planning
    • None
    • Query Optimization
    • QO 2024-12-23

      Those types of plans do not have any costs attached to them

      coll = db.foo;
      coll.drop();for (let i = 0; i < 1000; i++) {
           coll.insertMany([{a: i}]);
      }
      
      db.runCommand({analyze: "foo", key: "_id"});
      // EXPRESS_SCAN query
      db.foo.aggregate([{$match:{_id: 1}}]).explain().queryPlanner;
      // COUNT_SCAN query
      coll.explain().aggregate([{$match: {a: 2}}, {$count: "count"}]);

            Assignee:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Reporter:
            philip.stoev@mongodb.com Philip Stoev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: