Repository navigation
Cherry pick #128248 to 26.8: Leave the row estimate of a filtered array join unknown in join reordering - #128929
Conversation
…ering Since #126491 the array-join branch of `estimateReadRowsCount` estimates an array join as 100 rows per input row. It ignored both the filter passed from above (a `FilterStep` over the array join, e.g. with `query_plan_fuse_filter_into_array_join = 0`) and the step's own element filter (`ArrayJoinStep::hasElementFilter`), so a filtered array join got a known, inflated row count and `swap_on_sizes` built the hash table from the other, possibly much larger, input. Like the other branches of the function do for a filter they cannot account for, a filtered array join now has no row estimate, unless its input is estimated at 0 rows, which a filter cannot change. An unfiltered array join keeps the multiplier. Closes #128220 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The build side alone also passes with any known estimate of `s` up to 1000 rows, so N1-N3 now also count the plans showing `s[no_stats~?]`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-unknown Leave the row estimate of a filtered array join unknown in join reordering
`estimateReadRowsCount` is in `optimizeJoin.cpp` on 26.8: it moved to `RelationStatisticsEstimator.cpp` only with #120232, which is master-only. So the change of #128248 is applied there, on top of the 26.8 resolution of #126491, with one adaptation: `ArrayJoinStep` has no element filter on 26.8 (`query_plan_fuse_filter_into_array_join` does not exist there), so only a filter above the step leaves the row count unknown. The test `05406_join_swap_array_join_estimate` drops the settings that do not exist on 26.8 (`query_plan_fuse_filter_into_array_join`, `query_plan_lower_array_join_function`), so its "element filter" and "filter step" queries are the same query there. The reference is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The conflict is a modify/delete: On the 26.8 tree (clang-22, debug) I cannot push to |
|
🕵 Thanks @groeneai. I pushed your merge |
Original pull-request #128248
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job