Describe the bug
For inner/left/right/full joins, estimate_join_cardinality concatenates both inputs' column statistics verbatim and never adjusts them to the estimated output cardinality:
- Count-like fields (null_count, distinct_count, byte_size, sum_value) aren't scaled to the join's fan-out/selectivity, so they can be inconsistent with the output num_rows.
- Outer joins don't NULL-pad the non-preserved side, even though the side-to-pad is already known (utils.rs:240-242).
- Equi-join key columns aren't intersected (min/max) or NDV-bounded (min(left_ndv, right_ndv)).
Related to #22743 but the general join case might be a bit more involved.
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Describe the bug
For inner/left/right/full joins, estimate_join_cardinality concatenates both inputs' column statistics verbatim and never adjusts them to the estimated output cardinality:
Related to #22743 but the general join case might be a bit more involved.
To Reproduce
No response
Expected behavior
No response
Additional context
No response