You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/09/22 07:18:25 UTC
[GitHub] [doris] sohardforaname opened a new pull request, #12858: [Improve](Nereids)Optimize planner
sohardforaname opened a new pull request, #12858:
URL: https://github.com/apache/doris/pull/12858
# Proposed changes
Issue Number: close #xxx
## Problem summary
optimize planner
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [x] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [x] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [x] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [x] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [x] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #12858: [enhancement](Nereids) planner performance speed up
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #12858:
URL: https://github.com/apache/doris/pull/12858#issuecomment-1261688111
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morrySnow merged pull request #12858: [enhancement](Nereids) planner performance speed up
Posted by GitBox <gi...@apache.org>.
morrySnow merged PR #12858:
URL: https://github.com/apache/doris/pull/12858
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] jackwener commented on a diff in pull request #12858: [Improve](Nereids)Optimize planner
Posted by GitBox <gi...@apache.org>.
jackwener commented on code in PR #12858:
URL: https://github.com/apache/doris/pull/12858#discussion_r977328537
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostEstimate.java:
##########
@@ -90,11 +90,27 @@ public static CostEstimate ofMemory(double memoryCost) {
/**
* Sums partial cost estimates of some (single) plan node.
*/
+ @Deprecated
Review Comment:
No rename it, just remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] morrySnow commented on a diff in pull request #12858: [enhancement](Nereids) planner performance speed up
Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #12858:
URL: https://github.com/apache/doris/pull/12858#discussion_r982320377
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostEstimate.java:
##########
@@ -88,13 +86,17 @@ public static CostEstimate ofMemory(double memoryCost) {
}
/**
- * Sums partial cost estimates of some (single) plan node.
+ * sum of cost estimate
*/
public static CostEstimate sum(CostEstimate one, CostEstimate two, CostEstimate... more) {
- return Stream.concat(Stream.of(one, two), Stream.of(more))
- .reduce(zero(), (a, b) -> new CostEstimate(
- a.cpuCost + b.cpuCost,
- a.memoryCost + b.memoryCost,
- a.networkCost + b.networkCost));
+ double v1 = one.cpuCost + two.cpuCost;
+ double v2 = one.memoryCost + two.memoryCost;
+ double v3 = one.networkCost + one.networkCost;
Review Comment:
use meaningful variable names
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java:
##########
@@ -69,11 +69,11 @@ public List<List<PhysicalProperties>> getRequestChildrenPropertyList(GroupExpres
@Override
public Void visit(Plan plan, PlanContext context) {
- List<PhysicalProperties> requiredPropertyList = Lists.newArrayList();
- for (int i = 0; i < context.getGroupExpression().arity(); i++) {
- requiredPropertyList.add(PhysicalProperties.ANY);
+ List<PhysicalProperties> nCopyList = Lists.newArrayListWithCapacity(context.getGroupExpression().arity());
+ for (int i = context.getGroupExpression().arity(); i > 0; --i) {
Review Comment:
why use -- ?
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java:
##########
@@ -68,16 +68,17 @@ private static class JoinSlotCoverageChecker {
rightExprIds = right.stream().map(Slot::getExprId).collect(Collectors.toSet());
}
- boolean isCoveredByLeftSlots(Set<Slot> slots) {
- return slots.stream()
- .map(Slot::getExprId)
- .allMatch(leftExprIds::contains);
+ JoinSlotCoverageChecker(Set<ExprId> left, Set<ExprId> right) {
+ leftExprIds = left;
+ rightExprIds = right;
}
- boolean isCoveredByRightSlots(Set<Slot> slots) {
- return slots.stream()
- .map(Slot::getExprId)
- .allMatch(rightExprIds::contains);
+ boolean isCoveredByLeftSlots(ExprId slot) {
Review Comment:
add comment to explain why only one slot is enough
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java:
##########
@@ -152,37 +154,35 @@ public static Pair<List<Expression>, List<Expression>> extractExpressionForHashT
*/
public static Pair<List<ExprId>, List<ExprId>> getOnClauseUsedSlots(
Review Comment:
make sure these functions has enough unit test.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/RequestPropertyDeriver.java:
##########
@@ -69,11 +69,11 @@ public List<List<PhysicalProperties>> getRequestChildrenPropertyList(GroupExpres
@Override
public Void visit(Plan plan, PlanContext context) {
- List<PhysicalProperties> requiredPropertyList = Lists.newArrayList();
- for (int i = 0; i < context.getGroupExpression().arity(); i++) {
- requiredPropertyList.add(PhysicalProperties.ANY);
+ List<PhysicalProperties> nCopyList = Lists.newArrayListWithCapacity(context.getGroupExpression().arity());
Review Comment:
why rename it?
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpecHash.java:
##########
@@ -208,16 +214,18 @@ public boolean equals(Object o) {
return false;
}
DistributionSpecHash that = (DistributionSpecHash) o;
- return tableId == that.tableId && orderedShuffledColumns.equals(that.orderedShuffledColumns)
- && shuffleType == that.shuffleType && partitionIds.equals(that.partitionIds)
- && equivalenceExprIds.equals(that.equivalenceExprIds)
- && exprIdToEquivalenceSet.equals(that.exprIdToEquivalenceSet);
+ return shuffleType == that.shuffleType && orderedShuffledColumns.equals(that.orderedShuffledColumns);
+ // return tableId == that.tableId && orderedShuffledColumns.equals(that.orderedShuffledColumns)
+ // && shuffleType == that.shuffleType && partitionIds.equals(that.partitionIds)
+ // && equivalenceExprIds.equals(that.equivalenceExprIds)
+ // && exprIdToEquivalenceSet.equals(that.exprIdToEquivalenceSet);
}
@Override
public int hashCode() {
- return Objects.hash(orderedShuffledColumns, shuffleType, tableId, partitionIds,
- equivalenceExprIds, exprIdToEquivalenceSet);
+ // return Objects.hash(orderedShuffledColumns, shuffleType, tableId, partitionIds,
+ // equivalenceExprIds, exprIdToEquivalenceSet);
Review Comment:
ditto
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/DistributionSpecHash.java:
##########
@@ -208,16 +214,18 @@ public boolean equals(Object o) {
return false;
}
DistributionSpecHash that = (DistributionSpecHash) o;
- return tableId == that.tableId && orderedShuffledColumns.equals(that.orderedShuffledColumns)
- && shuffleType == that.shuffleType && partitionIds.equals(that.partitionIds)
- && equivalenceExprIds.equals(that.equivalenceExprIds)
- && exprIdToEquivalenceSet.equals(that.exprIdToEquivalenceSet);
+ return shuffleType == that.shuffleType && orderedShuffledColumns.equals(that.orderedShuffledColumns);
+ // return tableId == that.tableId && orderedShuffledColumns.equals(that.orderedShuffledColumns)
+ // && shuffleType == that.shuffleType && partitionIds.equals(that.partitionIds)
+ // && equivalenceExprIds.equals(that.equivalenceExprIds)
+ // && exprIdToEquivalenceSet.equals(that.exprIdToEquivalenceSet);
Review Comment:
remove it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #12858: [enhancement](Nereids) planner performance speed up
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #12858:
URL: https://github.com/apache/doris/pull/12858#issuecomment-1261688089
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org