Change TxId::num_distinct_values to return Option<NonZeroU64>.
It will now return None if either the table doesn't exist, no index
exists for the given column list, or the index is empty.
Otherwise, Some non-zero number of distinct values is returned.
Fixes a division-by-zero bug in the query row estimation.
Expected complexity level and risk
1
Testing
No functional change, estimation::index_row_est is now statically guaranteed
to not panic due to division-by-zero
Change
TxId::num_distinct_values
to returnOption<NonZeroU64>
.It will now return
None
if either the table doesn't exist, no index exists for the given column list, or the index is empty. Otherwise,Some
non-zero number of distinct values is returned.Fixes a division-by-zero bug in the query row estimation.
Expected complexity level and risk
1
Testing
No functional change,
estimation::index_row_est
is now statically guaranteed to not panic due to division-by-zero