imay 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_r231356980
##########
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:
I think dividing `FeConstants.default_replication_num` is not a good way.
Because table's number of replica maybe not equal with it, and even they are
equal, when balancing or some BE is down, `tablet.getQueryableReplicas` won't
return replica which isn't available. And then, `computeStats` will get a wrong
`cardinality`.
----------------------------------------------------------------
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]