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

   ### Background
   
   Doris reads deferred output columns after applying scan predicates. The 
reader receives the row IDs that survived filtering and gathers the 
corresponding values across data pages.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Performance
   
   Problem Summary:
   
   A batch of consecutive row IDs can incur repeated positioning and per-value 
collection across pages. Detect the continuous range once and use the existing 
sequential read path for deferred output columns.
   
   ### Details
   
   - **Why it was slow:** The row-ID read path positions the column iterator on 
each relevant page and gathers values individually.
   - **Optimization:** Check continuity when collecting the selected row IDs. 
For a consecutive batch, seek to the first row and read the range with 
`next_batch`.
   - **Results:** Warm Release A/B on one Intel Xeon Platinum 8457C host, using 
2,097,152 rows with 64-byte `VARCHAR` values and a 16 KiB data-page target. The 
filter selects 2,048 consecutive rows out of every 4,096. Each arm had six 
warm-ups and 30 timed executions per round, with opposite run order across the 
two rounds. These measurements compare the original implementation with the 
earlier string-gated revision of the sequential path.
   
     | Metric | Round 1, before → after | Round 2, before → after |
     | --- | ---: | ---: |
     | Query latency, median | 76.34 → 66.08 ms | 73.34 → 72.59 ms |
     | `LazyReadTime`, median of 7 profiled runs | 39.22 → 33.79 ms | 42.95 → 
37.96 ms |
   
   - **Applicability and cost:** The sequential path requires a contiguous 
batch of at least two surviving row IDs in the deferred output stage. Batches 
with gaps use the existing gather path. The continuity check runs while 
building the row-ID list.
   
   ### Testing
   
   The string workload returned identical row counts and checksums across both 
builds. Each candidate profile recorded 512 calls to the sequential branch.
   
   ### Release note
   
   Doris can read deferred output sequentially when selected rows form a 
contiguous range.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: string timings were collected 
before generalizing dispatch.
   
   ### AI Disclosure
   
   - Tool: Codex
   - Generated: Implementation, tests, and description.
   - Human review: The author reviewed the dispatch condition in the fork diff.
   


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