[ https://issues.apache.org/jira/browse/FLINK-5220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15725755#comment-15725755 ]
ASF GitHub Bot commented on FLINK-5220: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2923#discussion_r91081832 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/nodes/dataset/BatchScan.scala --- @@ -45,7 +45,8 @@ abstract class BatchScan( override def computeSelfCost (planner: RelOptPlanner, metadata: RelMetadataQuery): RelOptCost = { val rowCnt = metadata.getRowCount(this) - planner.getCostFactory.makeCost(rowCnt, rowCnt, 0) + val columnCnt = getRowType.getFieldCount --- End diff -- The first cost parameter is number of processed rows, second parameter indicates CPU cost, and third IO cost. I would not change the number of processed rows but add IO costs of `rowCnt * rowSize` where `rowSize` can be computed by `DataSetRel.estimateRowSize()`. Have a look at `DataSetCost` to check how costs are compared. The cost model aims at minimizing IO costs. So making here a difference results in the choice of the plan with the most projection. > Flink SQL projection pushdown > ----------------------------- > > Key: FLINK-5220 > URL: https://issues.apache.org/jira/browse/FLINK-5220 > Project: Flink > Issue Type: Improvement > Components: Table API & SQL > Reporter: zhangjing > Assignee: zhangjing > > The jira is to do projection pushdown optimization. Please go forward to the > the design document for more details. -- This message was sent by Atlassian JIRA (v6.3.4#6332)