-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
Have $_analyzeInternal route inputs to the appropriate histogram builder based on the input. There are four histogram builders – Scalar, ArrMin, ArrMax, and ArrUnique.
If the input is not one of the histogrammed types, per the scope document, increment the count in either the array or non-array
If isArray is false, route to Scalar
If isArray is true, do the following:
{ If this is the first time we've seen this document ID, route to ArrMin and ArrUnique, and store the value in a hash table with the document ID as key. Else If the types of the stored and new value for the document ID don't match, then sort all stored values, route them to ArrMax, and clear the hash table. Route the new value to ArrMin and ArrUnique and store the new value. Else If the values of the stored and new values don't match, then replace the stored value with the new value, and route the new value to ArrUnique. If the new and stored values match, we ignore the value. }Once we're finished processing, sort all the stored values, then route them to ArrMax.
- duplicates
-
SERVER-71513 Support array histograms in statistics
- Closed