diff options
Diffstat (limited to 'searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp')
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp index 2a0f1de0e44..33b249572f0 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp @@ -318,6 +318,11 @@ OrBlueprint::calculate_flow_stats(uint32_t) const { OrFlow::cost_of(get_children(), true) + flow::heap_cost(est, get_children().size())}; } +double +OrBlueprint::estimate_self_cost(InFlow in_flow) const noexcept { + return in_flow.strict() ? flow::heap_cost(estimate(), get_children().size()) : 0.0; +} + Blueprint::HitEstimate OrBlueprint::combine(const std::vector<HitEstimate> &data) const { @@ -431,6 +436,11 @@ WeakAndBlueprint::calculate_flow_stats(uint32_t docid_limit) const { OrFlow::cost_of(get_children(), true) + flow::heap_cost(est, get_children().size())}; } +double +WeakAndBlueprint::estimate_self_cost(InFlow in_flow) const noexcept { + return in_flow.strict() ? flow::heap_cost(estimate(), get_children().size()) : 0.0; +} + Blueprint::HitEstimate WeakAndBlueprint::combine(const std::vector<HitEstimate> &data) const { @@ -507,6 +517,11 @@ NearBlueprint::calculate_flow_stats(uint32_t) const { AndFlow::cost_of(get_children(), true) + childCnt() * est}; } +double +NearBlueprint::estimate_self_cost(InFlow) const noexcept { + return childCnt() * estimate(); +} + Blueprint::HitEstimate NearBlueprint::combine(const std::vector<HitEstimate> &data) const { @@ -572,6 +587,11 @@ ONearBlueprint::calculate_flow_stats(uint32_t) const { AndFlow::cost_of(get_children(), true) + childCnt() * est}; } +double +ONearBlueprint::estimate_self_cost(InFlow) const noexcept { + return childCnt() * estimate(); +} + Blueprint::HitEstimate ONearBlueprint::combine(const std::vector<HitEstimate> &data) const { |