Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import org.apache.doris.nereids.properties.DistributionSpecHash;
import org.apache.doris.nereids.properties.DistributionSpecReplicated;
import org.apache.doris.nereids.trees.expressions.ComparisonPredicate;
import org.apache.doris.nereids.trees.expressions.ExprId;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SlotReference;
import org.apache.doris.nereids.trees.expressions.literal.Literal;
import org.apache.doris.nereids.trees.plans.Plan;
Expand Down Expand Up @@ -60,6 +62,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -273,10 +276,11 @@ public Cost visitPhysicalDistribute(
// shuffle
if (spec instanceof DistributionSpecHash) {
return CostV1.of(context.getSessionVariable(),
0,
intputRowCount / beNumber,
0,
intputRowCount * childStatistics.dataSizeFactor(
distribute.child().getOutput()) / beNumber);
distribute.child().getOutput()) / beNumber
);
}

// replicate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ public double computeSize(List<Slot> slots) {
}

public double dataSizeFactor(List<Slot> slots) {
double lowerBound = 0.03;
double upperBound = 0.07;
return Math.min(Math.max(computeTupleSize(slots) / K_BYTES, lowerBound), upperBound);
return 0.05 * computeTupleSize(slots);
}

@Override
Expand Down