to 4.0: optimize data branch merge apply execution#24858
Open
gouhongshen wants to merge 2 commits into
Open
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
7 tasks
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
heni02
approved these changes
Jun 5, 2026
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.
What type of PR is this?
Which issue(s) this PR fixes:
Related issue #24099
What this PR does / why we need it:
DATA BRANCH MERGEmaterializes row differences into__mo_diff_*helper tables, then applies them to the base table with base-table DML that reads those helper tables.runSqlpreviously routed every statement mentioning__mo_diff_*throughBackgroundExec. That was needed for temp-table DDL and temp-table-targeting DML, but it was too broad for the base-table delete/insert apply statements. On a 100M-row table with only 1000 updated rows, the apply phase spent seconds on the slower path.This change keeps
BackgroundExecfor data-branch temp table DDL and DML that targets__mo_diff_*tables, while allowing base-table DML that only reads those helper tables to use the internal SQL executor.Validation:
CGO_CFLAGS="-I$(pwd)/thirdparties/install/include" go test ./pkg/frontend./run.sh -p /Users/ghs-mo/MOWorkSpace/matrixone-2nd/test/distributed/cases/ -i git4data/branch:TOTAL 2968, SUCCESS 2968, FAILED 0,report/error.txtempty