ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL
    • Hide
      db.adminCommand({ setParameter: 1, internalQueryPlanRanker: 'costBased' })
      db.a.drop()
      db.a.createIndex({a:1, "$**": 1}, {wildcardProjection: {c: 1, d: 1}})
      db.a.insertOne({a: 0, c:0, d: 0})
      db.a.explain("executionStats").find({a: 0})
      

      This results in:
      numKeysEstimate: 1
      keysExamined:2

      Show
      db.adminCommand({ setParameter: 1, internalQueryPlanRanker: 'costBased' }) db.a.drop() db.a.createIndex({a:1, "$**" : 1}, {wildcardProjection: {c: 1, d: 1}}) db.a.insertOne({a: 0, c:0, d: 0}) db.a.explain( "executionStats" ).find({a: 0}) This results in: numKeysEstimate: 1 keysExamined:2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-134637 introduced support for costing hashed/collated/wildcard indices. As "generic" index scans on wildcard indices essentially scan keys for all the fields indexed under the wildcard, they all must be included in the sample to get realistic estimates.

            Assignee:
            Unassigned
            Reporter:
            Kartal Kaan Bozdogan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: