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

   ### What problem does this PR solve?
   
   A single short string equality key currently uses a pointer and length for 
each build and probe row. Matching a candidate can require another read of the 
build string. Scan the build keys once and choose a 4-, 8-, or 16-byte packed 
integer key when the values fit. This reuses the existing numeric hash and the 
join table's bucket chains.
   
   Build strings with trailing zero bytes or a length above 16 keep the 
existing string path. A probe string that is too long or ends in a zero byte 
can have no exact match in a packed table. Route it to an empty bucket distinct 
from the SQL NULL bucket. Hash collisions still use exact key equality.
   
   Single-thread Doris INNER JOIN kernel, 1,048,576 build and probe rows, 100% 
matches, median of ten alternating runs. Total time includes shape selection, 
key preparation, hashing, build, and probe.
   
   | String length | Key width | Before | After |
   |---|---:|---:|---:|
   | 4 bytes | 4 bytes | 117.02 ms | 54.58 ms |
   | 8 bytes | 8 bytes | 197.01 ms | 81.27 ms |
   | 12 bytes | 16 bytes | 201.85 ms | 101.73 ms |
   | 16 bytes | 16 bytes | 187.21 ms | 89.12 ms |
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
     - [x] Standalone Doris JOIN kernel check under ASAN and UBSAN. Covered all 
widths, embedded and trailing zero bytes, arbitrary bytes, bucket collisions, 
oversized probe keys, NULL keys, duplicates, and output continuations.
     - [x] Syntax checks for both JOIN operators, all probe instantiations, and 
the new BE test.
     - [ ] Full BE unit suite. The local test runner stopped at missing Google 
Cloud static archives during build.
   - Behavior changed: No change to JOIN results.
   - Does this need documentation: No.
   


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