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

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Problem Summary: Single-tablet OLAP queries can still introduce a gather 
exchange before scalar aggregation. Root cause: the scan distribution does not 
advertise that the complete input can execute in one storage-bound instance. 
Add a storage-gather scan alternative while retaining the natural distribution 
for join planning, and preserve its placement constraints through sorting and 
fragment-merging boundaries.
   
   The optimization requires the Nereids distribute planner, effective 
parallelism of one, and query cache disabled. Sampling and special scan modes 
retain the existing path.
   
   ### Release note
   
   Add `enable_single_tablet_gather` (default true) to eliminate unnecessary 
gather exchanges for eligible single-tablet OLAP queries.
   
   ### Check List (For Author)
   
   - Test:
       - [x] Unit Test: 9 focused FE tests passed before the final 
legacy-planner gate was added.
       - [x] Regression test: `single_tablet_gather` generated with 
`-forceGenOut` and rerun successfully before that gate was added.
       - [x] Manual test: FE build/Checkstyle and single-instance profile 
checks passed before that gate was added; the scalar query used one fragment 
without an exchange. Random distribution and selected rollup checks also passed.
       - Final legacy-planner gate and its added assertion were 
source-reviewed; build/tests have not been rerun for that adjustment. Multi-BE 
execution remains untested.
   - Behavior changed:
       - [x] Yes. Eligible single-tablet queries can execute without a gather 
exchange.
   - Does this need documentation?
       - [x] No. The session variable describes the supported scope.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


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