kangkaisen commented on a change in pull request #256: Improve cardinality, 
avgRowSize, numNodes stat info in OlapScanNode
URL: https://github.com/apache/incubator-doris/pull/256#discussion_r231101584
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/planner/OlapScanNode.java
 ##########
 @@ -447,6 +465,13 @@ private void addScanRangeLocations(Partition partition,
                 scanRangeLocations.addToLocations(scanRangeLocation);
                 paloRange.addToHosts(new TNetworkAddress(ip, port));
                 tabletIsNull = false;
+
+                //for CBO
+                if (replica.getRowCount() != -1) {
+                    cardinality += replica.getRowCount();
+                    totalBytes += replica.getDataSize();
+                }
+                scanBackendIds.add(backend.getId());
 
 Review comment:
   Yes. I see.  I know only one replica will be read.
   the `cardinality ` and `avgRowSize` is only for one replica.  the 
`cardinality ` and `avgRowSize` will divide replication_num in `computeStats`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to