Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: fix internal error "estimated row count must be non-zero"
Release justification: low risk, high benefit changes to existing functionality This commit fixes a rare error that could occur when a query had many highly selective filter predicates. This error occured when the estimated selectivity of a Select operator was 0. Prior to this commit, we prevented the selectivity of a single filter from ever going below 1e-10, but to get the overall selectivity we multiplied the individual selectivities together. We only needed 32 filter conditions in which the selectivity was 1e-10 for the overall selectivity to underflow the floating point representation and result in selectivity 0. This commit fixes the error by setting the selectivity to 1e-10 *after* multiplying the individual selectivities together if it is less than 1e-10. Fixes cockroachdb#53311 Release note (bug fix): Fixed a rare internal error that could occur during planning of queries with many highly selective predicates.
- Loading branch information