andygrove commented on PR #27998:
URL: https://github.com/apache/datafusion/pull/27998#issuecomment-7392042574

   Looked into the `hj` regression. It comes from partition count alone: the 
same binary with `--partitions 16` vs `32` reproduces it.
   
   The queries that regress (Q5/7/9/11/13) set `join_reordering = false` and 
put `lineitem` on the left, so the hash table is built on the 60M-row side 
(~750 MB) and probed with 100K rows. Each probe row matches ~600 build rows. 
Producing the output means following match chains scattered through 750 MB, so 
most steps miss cache and wait on memory. That's the case where SMT helps. Q9 
numbers:
   
   | partitions | join CPU time (summed over partitions) | wall |
   |---|---:|---:|
   | 32 | 10.7 s | 438 ms |
   | 16 | 6.9 s | 545 ms |
   
   Q3 has the same row counts but builds on `supplier` (small, fits in cache), 
and it's 14% *faster* at 16.
   
   With reordering on (the default), Q9 builds on `supplier`, is ~6x faster 
either way, and the gap shrinks to 61 ms vs 67 ms. I haven't explained the 
remaining ~6 ms. I also haven't checked the semi/anti cases (Q18/20/22), and I 
don't have hardware counters to back up the cache-miss part yet.
   
   (Analysis done with Claude Code.)
   


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