github-actions[bot] commented on code in PR #69850:
URL: https://github.com/apache/doris/pull/69850#discussion_r4425387524


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -470,6 +471,17 @@ private boolean isRegisteredRowCount(OlapScan olapScan) {
      */
     private double getOlapTableRowCount(OlapScan olapScan) {
         OlapTable olapTable = olapScan.getTable();
+        if (olapTable instanceof OlapTableWrapper) {

Review Comment:
   [P1] Preserve changelog row counts when base-table stats are user-injected. 
A direct @incr scan uses the legacy OlapChangelogTableWrapper constructors, so 
getRowCountEstimate() is UNKNOWN_ROW_COUNT. When a user injects only the 
base-index row count, StatsCalculator's userInjected branch then looks up the 
wrapper's changelog index and gets -1, and computeOlapScan raises that to the 
one-row floor without calling the wrapper's delegated changelog-index count. A 
large changelog can therefore be selected as a broadcast build. Fall back to 
the wrapper/origin changelog-index count when the injected statistic has no 
entry for the selected index, and add a direct @incr planner regression for 
this base-index-only injection.



-- 
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