MDEV-37936 Followup to MDEV-36321: out_rows for GROUP BY: use of item… #4415
+232
−47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… names?
MDEV-36321 compared item name strings when looking for key use in items of the select list within a derived table. Here we remove this type of comparison and compare the underlying fields and their position.
Description
For better query planning, we need better row count estimation when planning our join strategy. MDEV-36321 introduced a fix for rows out in a derived table with a grouping or distinct attribute. It compared item name strings when looking for key use in items of the select list, which isn't valid. Here we remove this type of comparison and compare the underlying fields and their position.
Release Notes
Potentially improved query plans with grouping or distinct selects in derived tables.
How can this PR be tested?
mtr main.derived_opt
Basing the PR against the correct MariaDB version
mainbranch.PR quality check