Skip to content

Commit

Permalink
[opt](nereids) refine operator estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjian.xzj authored and zhongjian.xzj committed Sep 23, 2024
1 parent 3c49f26 commit 61a9a33
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,10 @@ private Statistics estimateColumnEqualToColumn(Expression leftExpr, ColumnStatis
double numNull = keepNull ? Math.min(leftStats.numNulls, rightStats.numNulls) : 0;
intersectBuilder.setNumNulls(numNull);

double origRowCount = context.statistics.getRowCount();
double leftNotNullSel = Statistics.getValidSelectivity(1 - (leftStats.numNulls / origRowCount));
double rightNotNullSel = Statistics.getValidSelectivity(1 - (rightStats.numNulls / origRowCount));
// TODO: consider notNullSelectivity
//double origRowCount = context.statistics.getRowCount();
double leftNotNullSel = 1.0; //Statistics.getValidSelectivity(1 - (leftStats.numNulls / origRowCount));
double rightNotNullSel = 1.0; //Statistics.getValidSelectivity(1 - (rightStats.numNulls / origRowCount));
double notNullSel = 1 / StatsMathUtil.nonZeroDivisor(Math.max(leftStats.ndv, rightStats.ndv))
* (keepNull ? 1 : leftNotNullSel * rightNotNullSel);

Expand Down

0 comments on commit 61a9a33

Please sign in to comment.