-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
Let's try the following:
- Create a new C++ unit test in a new file, with similar dependencies as sbe_abt_test.cpp.
- Write a single example:
- query in MQL
- input documents
- index specs
- Translate the query to ABT
- Get the query results as naively as possible. For example:
- Disable constant folding
- Disable exploration rewrites
- Use a ScanDef with no indexes
- Generate all query plans:
- Leave constant folding, exploration, everything else enabled.
- Disable branch and bound.
- Keep rejected plans.
- Run OptPhaseManager once.
- Write a new function that extracts all plans from the final memo.
- Lower to SBE, and run, each plan.
- Compare each result to the naive result.
- Use sorting to ignore both field order, and document order.
In other words, this is a property test that holds the query and input data fixed, and asserts: all plans for this query are correct. This means optimization bugs can't hide behind costing decisions. But we still have control over which examples we test.
This will also be a good opportunity to test cost predictions.
- depends on
-
SERVER-73552 [CQF] Add ability to enumerate all plans
- Closed
- is related to
-
SERVER-74869 [CQF] Add ability to select an alternative execution plan from a JS test
- Open
- related to
-
SERVER-68063 Ability to define a sub-set of unit tests as a scons target
- Closed