-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
-
Fully Compatible
-
ALL
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.