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

   ### What problem does this PR solve?
   
   Issue Number: close #66879
   
   Related PR: #54936, #60513, #62222
   
   Problem Summary:
   
   For UNIQUE MOR tables with sequence mapping, one logical row can be 
assembled from physical rows written by independent update streams. Value 
predicates cannot be applied as final filters before MOR merge without risking 
false negatives. As a result, selective indexed `EQ`/`IN` predicates still take 
the normal full MOR scan path.
   
   This PR adds an opt-in two-phase candidate-key scan:
   
   1. Group indexed `EQ`/`IN` predicates by sequence-mapping column.
   2. Scan physical rows to collect a conservative UNIQUE KEY set for each 
group.
   3. Intersect key sets across sequence groups.
   4. Run the normal MOR reader over point-key ranges and retain the original 
residual predicates for final correctness.
   
   The candidate phase falls back to the normal MOR path when:
   
   - no supported indexed driver exists or inverted-index query is disabled;
   - scanner splits are partial;
   - candidate count exceeds `seq_map_candidate_key_max_count`;
   - estimated candidate scan plus point-probe cost reaches the full-scan cost;
   - candidate collection returns an error.
   
   The optimization is disabled by default through 
`enable_seq_map_candidate_key_scan=false`.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
       - [x] Regression test
       - [x] Unit Test
       - [ ] Manual test
       - [ ] No need to test or manual test
   - [ ] This is a refactor/code format and no logic has been changed.
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Queries can use candidate-key pruning only when the opt-in 
session variable is enabled; the default path is unchanged.
   - Does this need documentation?
       - [x] No. The optimization is experimental and disabled by default.
       - [ ] Yes.
   
   Validation:
   
   - Targeted BE compilation for the modified scan/storage objects
   - `SessionVariablesTest`: 17 tests passed
   - `./run-regression-test.sh --compile`
   
   ### 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