Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/5043#discussion_r152532789
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/logical/FlinkLogicalTableSourceScan.scala
---
@@ -62,7 +62,19 @@ class FlinkLogicalTableSourceScan(
override def computeSelfCost(planner: RelOptPlanner, metadata:
RelMetadataQuery): RelOptCost = {
val rowCnt = metadata.getRowCount(this)
- planner.getCostFactory.makeCost(rowCnt, rowCnt, rowCnt *
estimateRowSize(getRowType))
+
+ val adjustedCnt: Double = tableSource match {
+ case f: FilterableTableSource[_] if f.isFilterPushedDown =>
+ // ensure we prefer FilterableTableSources with pushed-down
filters.
+ rowCnt - 1.0
--- End diff --
Shouldn't this be something like `rowCnt * 0.33`?
---