-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
There are a few operations in PartialSchemaReqConverter that are unnecessarily quadratic on the number of PSR entries.
#1
This loop in intersectPartialSchemaReq iterates through every entry in the PSR DNF, looking for an existing requirement that meets the condition newKey.projectionName == existingReq.boundProjectionName. Instead of searching through the entire structure, PSR can hold a map of Requirement Bound Projection -> Atom Node::reference_type
#2
Every time we call add in intersectPartialSchemaReq, the PSR renormalizes, which involves resorting and deduplicating the entire structure. We could either normalize after converting to PSR, or insert into the structure in a way that keeps it in a normalized state. If the PSR is normalized later on in optimization, we could avoid normalizing altogether.
These are the first solutions I thought of, it's possible a larger refactor might be more ideal.
- duplicates
-
SERVER-80735 [CQF] Lazy simplification
- Backlog
- related to
-
SERVER-62509 Write tests to stress ABT and Bonsai
- Closed
-
SERVER-81822 Complete TODO listed in SERVER-78635
- Closed