morrySnow commented on code in PR #63974:
URL: https://github.com/apache/doris/pull/63974#discussion_r3361817521


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/query/QueryStatsRecorder.java:
##########
@@ -351,6 +443,9 @@ private static void walkPlan(Plan plan,
                                 exprIdToColName.put(ne.getExprId(), colName);
                             }
                         }
+                    } else if (inputSlots.size() > 1) {
+                        recordInputSlotsAsQueryHit(((Alias) ne).child(),

Review Comment:
   This records multi-input aliases from every `PhysicalProject` as `queryHit`, 
but not every project here is the final SELECT projection. 
`PushDownExpressionsInHashCondition` can insert child projects for join keys 
such as `t1.a + t1.b = t2.c`; in that real plan shape this branch records `a` 
and `b` as query hits even though they are only used by the join predicate and 
should be filter hits. The project walker needs to propagate the alias ExprId 
to its input slots for parent filter/join expansion, or limit direct `queryHit` 
recording to the root output project, otherwise column query stats are 
overcounted for internal computed predicates.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to