Histogram estimates for {a: null} ignores documents with missing fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: Query Planning
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Values that are missing from a document are not reflected in the histograms. So the estimate of predicates such as {{

      {a:null}

      }} reflects only the documents where a is explicitly null but not documents where a is missing altogether. Both type of rows match this predicate, so the estimate should reflect the sum of both.

      Cause

      In histogram generation, documents missing the field increments the counts for TypeTags::Nothing rather than TypeTags::Null.

      In histogram estimation, interval like [null, null] only consults the counts for TypeTags::Null.

      Plan of Attack

      In type counts estimation, if an interval is [null, null], adds the counts from both Null and Nothing.

              Assignee:
              Chi-I Huang
              Reporter:
              Chi-I Huang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: