JeonDaehong opened a new issue, #1161:
URL: https://github.com/apache/paimon-rust/issues/1161

   ### Search before asking
   
   - [x] I searched in the issues and found nothing similar.
   
   ### Motivation
   
   `sort_merge_stream` allocates for every primary key it merges: 
`current_row().owned()` for the winner key and a new `Vec<MergeRow>` for the 
rows sharing it. Both can be reused across keys. Encoded rows compare by their 
bytes, so the key check can compare against a reused byte buffer.
   
   On a primary-key table with 2M keys written three times (6M input rows, 4 
files per round, memory FileIO, c7i.4xlarge, release build), a full read goes 
from 463 ms to 427 ms, about 8%, with and without 
`deletion-vectors.merge-on-read`. Six alternating runs each, ranges don't 
overlap.
   
   ### Solution
   
   Keep the key buffer and the row list outside the loop and clear them per key.
   
   ### Anything else?
   
   _No response_
   
   ### Willingness to contribute
   
   - [x] I'm willing to submit a PR!
   


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

Reply via email to