Skip to content

Commit

Permalink
[opt](nereids) fix non-null selectivity computing
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjian.xzj committed Oct 22, 2024
1 parent cd5f9d7 commit ffb75e5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public void normalizeColumnStatistics(double inputRowCount, boolean isNumNullsDe
// the following columnStatistic.isUnKnown() judgment is loop inside since current doris
// supports partial stats deriving, i.e, allowing part of tables have stats and other parts don't,
// or part of columns have stats but other parts don't, especially join and filter estimation.
if (!checkColumnStatsValid(columnStatistic, rowCount) && !columnStatistic.isUnKnown()) {
if ((!checkColumnStatsValid(columnStatistic, rowCount) && !columnStatistic.isUnKnown())
|| isNumNullsDecreaseByProportion && columnStatistic.numNulls != 0) {
ColumnStatisticBuilder columnStatisticBuilder = new ColumnStatisticBuilder(columnStatistic);
double ndv = Math.min(columnStatistic.ndv, rowCount);
double numNulls = Math.min(columnStatistic.numNulls * factor, rowCount - ndv);
Expand Down

0 comments on commit ffb75e5

Please sign in to comment.