yujun777 opened a new pull request, #70922:
URL: https://github.com/apache/doris/pull/70922

   ### Background
   
   An incremental materialized view refresh joins changes from one input with a 
snapshot of the other input. Doris builds the hash table on the right input. 
Outer joins also check snapshots for rows whose match status changed.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Performance
   
   Problem Summary: When join reordering is disabled, a refresh can build a 
hash table over an entire snapshot even for a small delta. Generate equivalent 
joins with the delta as the default build input for append-only and 
merge-on-write views. Preserve that starting direction through the early 
rewrite of right outer and right anti joins so it reaches physical planning 
when the statistics checks disable reordering.
   
   ### Details
   
   - **Why it was slow:** The expansion inherited the source join's left and 
right positions. Null-repair anti joins built on the snapshot, and early 
rewrite normalized equivalent right joins back to left joins before the final 
statistics checks.
   - **Optimization:** Commute eligible joins after mapping the delta and 
snapshot to the original input slots. Preserve the pre/post snapshot 
boundaries, output slots, and compensation events.
   - **Results:** The regression checks the physical join type and input order 
for append-only inner, merge-on-write inner and outer, and null-repair anti 
joins with join reordering disabled. This is a plan check and result 
comparison. No latency or memory benchmark was run.
   - **Applicability and cost:** The default is most useful for small change 
batches and selective join keys. Right outer and right anti joins may require 
shuffle and can increase exchange cost. Explicit distribution hints are 
respected, and non-equi left outer and left anti joins retain parallel 
execution.
   
   ### Testing
   
   - FE build and Checkstyle passed.
   - All 189 selected FE tests passed across the initial run and the rerun of 
IvmJoinDeltaHandlerTest.
   - All 8 focused IVM suites passed on a local FE/BE cluster, including the 
new plan assertions and NULL-repair checks.
   - The wider IVM directory run used an older BE that lacks several aggregate 
functions and system table fields. Full matching-version coverage is left to CI.
   
   ### Release note
   
   Incremental materialized view refreshes prefer the delta as the hash join 
build input when the join can be commuted.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified. Full IVM coverage requires a 
matching BE build.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to