morrySnow commented on code in PR #14526: URL: https://github.com/apache/doris/pull/14526#discussion_r1033158873
########## fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java: ########## @@ -89,7 +88,7 @@ public void plan(StatementBase queryStmt, org.apache.doris.thrift.TQueryOptions PhysicalPlan physicalPlan = (PhysicalPlan) resultPlan; PhysicalPlanTranslator physicalPlanTranslator = new PhysicalPlanTranslator(); PlanTranslatorContext planTranslatorContext = new PlanTranslatorContext(cascadesContext); - if (ConnectContext.get().getSessionVariable().isEnableNereidsTrace()) { + if (true) { Review Comment: ? ########## fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java: ########## @@ -49,6 +49,8 @@ public class GroupExpression { private final BitSet ruleMasks; private boolean statDerived; + private long estOutputRowCount = -1; Review Comment: why add this to group expression? we could get row count from group ########## fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java: ########## @@ -240,27 +242,31 @@ public StatsDeriveResult childStatistics(int idx) { return new StatsDeriveResult(child(idx).getStatistics()); } + public void setEstOutputRowCount(long estOutputRowCount) { + this.estOutputRowCount = estOutputRowCount; + } + + public long getEstOutputRowCount() { + return estOutputRowCount; + } + @Override public String toString() { StringBuilder builder = new StringBuilder(); - if (ownerGroup == null) { - builder.append("OWNER GROUP IS NULL[]"); - } else { Review Comment: we need this branch to find bugs ########## fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java: ########## @@ -76,7 +75,7 @@ private StatsDeriveResult calculate(Expression expression) { @Override public StatsDeriveResult visit(Expression expr, EstimationContext context) { - return new StatsDeriveResult(inputStats).updateBySelectivity(DEFAULT_INEQUALITY_COMPARISON_SELECTIVITY); + return inputStats.updateBySelectivity(DEFAULT_INEQUALITY_COMPARISON_SELECTIVITY); Review Comment: if this function generate new StatsDeriveResult, renam this function to withSelectivity ########## fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java: ########## @@ -511,4 +511,22 @@ public Set<String> getPartitionNames() { public AnalysisJob createAnalysisJob(AnalysisJobScheduler scheduler, AnalysisJobInfo info) { throw new NotImplementedException(); } + + /** + * for NOT-ANALYZED Olap table, return estimated row count, + * for other table, return 1 Review Comment: should we return nagtive number and generate a default row number when derive stats? -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org