Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

we should set upper bound to cur cost. #1648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/optimizer/optimizer_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void OptimizeExpressionCostWithEnforcedProperty::Execute() {
// Can meet the requirement
if (meet_requirement && cur_total_cost_ <= context_->GetCostUpperBound()) {
// If the cost is smaller than the winner, update the context upper bound
context_->SetCostUpperBound(context_->GetCostUpperBound() - cur_total_cost_);
context_->SetCostUpperBound(cur_total_cost_);
if (memo_enforced_expr != nullptr) { // Enforcement takes place
cur_group->SetExpressionCost(memo_enforced_expr, cur_total_cost_, context_->GetRequiredProperties()->Copy());
} else if (output_prop->Properties().size() != context_->GetRequiredProperties()->Properties().size()) {
Expand Down