You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2018/11/06 11:05:54 UTC

[GitHub] imay commented on a change in pull request #256: Improve cardinality, avgRowSize, numNodes stat info in OlapScanNode

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_r231081814
 
 

 ##########
 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:
   OlapScanNode will put one tablet's all replicas to paloRange, because Coordinator will balance these replicas and try to make that each backend will scan same rows.
   
   However, not all replicas will be read. If table has 3 replica, only one can be read. And this patch will add scan rows three times.
   
   So, you can change cardinality and totalBytes outsize for each tablet other than replica.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org