When computing minRowCount for Union, it doesn't task into account UNION DISTINCT.
public Double getMinRowCount(Union rel, RelMetadataQuery mq) { double rowCount = 0.0; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getMinRowCount(input); if (partialRowCount != null) { rowCount += partialRowCount; } } return rowCount; }
- links to