[SERVER-67366] Extend $analyzeInternal to create histograms Created: 17/Jun/22  Updated: 05/Dec/22  Resolved: 30/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Joel Redman (Inactive) Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-71513 Support array histograms in statistics Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

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.



 Comments   
Comment by Alya Berciu [ 30/Nov/22 ]

I believe this ticket duplicates SERVER-71513 which has just been merged, so I'm closing it as a duplicate.

Generated at Thu Feb 08 06:07:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.