-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
0
Current CBR implementation invokes
CardinalityEstimate estimateCardinality(const MatchExpression* expr)
for each node in the query solution tree. This entails the scanning of the pre-generated sample for each predicate.
Sampling CE exposes also
std::vector<CardinalityEstimate> estimateCardinality(const std::vector<const MatchExpression*>& expr)
Which aims to reduce the number of memory misses by evaluating all predicates on a document rather than fetching each document for each predicate.
This ticket extends CBR implementation to allow the use of the latter API. Thus, collect all predicates and populate the cardinality estimates before traversing the QSN tree and calculating the query cost.
This ticket should also include a sanity analysis regarding the prospective performance benefits from batching cardinality estimation requests for sampling CE.