Skip to content

Conversation

@mariadb-RexJohnston
Copy link
Member

@mariadb-RexJohnston mariadb-RexJohnston commented Nov 2, 2025

… 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.

  • The Jira issue number for this PR is: MDEV-37936

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

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants