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

   ### Background
   
   The BE segment iterator decodes predicate columns into scratch columns. It 
applies scan and delete predicates, then uses the selected row positions to 
populate the output Block.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Performance
   
   Problem Summary:
   
   Selector output copies a predicate column even when the predicates retain 
every row in the batch. When the input and output column representations match, 
the iterator can hand the decoded column directly to the Block and reuse the 
Block's cleared column for the next read.
   
   ### Details
   
   - **Why it was slow:** The selector output loop gathers each value into 
another column even when the selection is the identity.
   - **Optimization:** Compare the input and survivor counts after scan and 
delete predicates. On a full selection, exchange the pointers if the decoded 
column is complete and matches the output representation. The existing selector 
path handles partial selections and conversions, including nullable dictionary 
strings.
   - **Results:** An 8,192-row BIGINT predicate column avoids copying 64 KiB of 
values at output. Unit tests check pointer identity on the handoff path. 
End-to-end latency and throughput were not measured.
   - **Applicability and cost:** The additional column representation check 
runs only for full selections. The reused scratch column keeps its capacity and 
grows through the regular read path.
   
   ### Testing
   
   - ASAN BE unit tests passed 11 cases across 
`SegmentIteratorPredicateOutputTest`, `SegmentIteratorTopNRuntimeFilterTest`, 
and `SegmentIteratorNullableTopNRuntimeFilterTest`. The string test uses two 
rows and exercises both direct handoff and dictionary decoding.
   - clang-format 16, BE header hygiene, and changed-line clang-tidy checks 
passed.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: Release A/B performance was not 
measured.
   
   ### AI Disclosure
   
   - Tool: OpenAI Codex (GPT-6)
   - Generated: Implementation, unit tests, and description.
   - Human review: The author reviewed the predicate column handoff and 
requested a simpler string test.
   


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