|
When we estimate individual predicates, we put the results in a logical property:
"| | Logical:\n"
|
"| | cardinalityEstimate: \n"
|
"| | ce: 189.571\n"
|
"| | requirementCEs: \n"
|
"| | refProjection: root, path: 'PathGet [a] PathIdentity []', ce: 330\n"
|
"| | refProjection: root, path: 'PathGet [b] PathGet [c] PathIdentity "
|
"[]', ce: 330\n"
|
https://github.com/10gen/mongo/blob/7ab5c60c1c99ac7ecfbf9e79d5de08dd29fcb37a/src/mongo/db/query/optimizer/physical_rewriter_optimizer_test.cpp#L3299-L3301
Let's also include a string describing which CE method was used.
- Change the deriveCE() method to return pair<CEType, std::string>.
- Each CE implementation should return a short string like "heuristic" or "sampling".
- When one CE implementation delegates to another (like when sampling falls back to heuristic) we should report the ultimate source of the CEType (heuristic) and not the wrapper.
- Update the PartialSchemaKeyCE structure (in CardinalityEstimate) to hold the string for each estimate.
- Update explain.
|