Re: clamp_row_est avoid infinite

2024-04-22 Thread Tom Lane
jian he writes: > if (nrows > MAXIMUM_ROWCOUNT || isnan(nrows)) > nrows = MAXIMUM_ROWCOUNT; > else if (nrows <= 1.0) > nrows = 1.0; > else > nrows = rint(nrows); > The comments say `Avoid infinite and NaN` > but actually we only avoid NaN. Really? The IEEE float arithmetic standard

clamp_row_est avoid infinite

2024-04-22 Thread jian he
hi. /* * clamp_row_est * Force a row-count estimate to a sane value. */ double clamp_row_est(double nrows) { /* * Avoid infinite and NaN row estimates. Costs derived from such values * are going to be useless. Also force the estimate to be at least one * row, to make explain output look