MDEV-38177: FULL OUTER JOIN Allowed JOIN Orders#4512
Closed
DaveGosselin-MariaDB wants to merge 2 commits into12.3-MDEV-38136-table-eliminationfrom
Closed
MDEV-38177: FULL OUTER JOIN Allowed JOIN Orders#4512DaveGosselin-MariaDB wants to merge 2 commits into12.3-MDEV-38136-table-eliminationfrom
DaveGosselin-MariaDB wants to merge 2 commits into12.3-MDEV-38136-table-eliminationfrom
Conversation
This is a small cleanup commit ahead of the feature work for this MDEV: - Upgrade JOIN::get_allowed_nj_tables, JOIN::calc_allowed_top_level_tables to const methods as they have no side-effects and don't mutate object state - Document that JOIN_TAB::tab_list is the same as JOIN_TAB::table->pos_in_table_list - Direct access to nj_map replaced by functions to clarify expected usage - Remove a dead code path not executed by any regression tests - Invert and dedent a couple of loops to keep the happy path on the left - Cleanup restore_prev_nj_state and build_bitmap_for_nested_joins
Check that tables participating in a FULL OUTER JOIN are not separated from each other when trying new extenions to the query plan. Some tables t1, t2 participating in FULL OUTER JOIN should remain adjacent in the final JOIN order, otherwise wrong results will be computed. In this patch, tables in a FULL OUTER JOIN remember who their JOIN partner is. When JOINs are nested, these partners are preserved and checked when walking the nested JOIN tree during check_interleaving_in_nj. This code accounts for the case when tables in a FULL OUTER JOIN may themselves be nested joins, such as (t1, t2) FULL OUTER JOIN t3.
d5e0339 to
2d8ad76
Compare
Member
Author
|
Closing this PR in favor of reviewing via branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR covers two commits, one is a small cleanup commit and the other is the feature work.
Cleanup commit:
Feature commit: