yyy1000 commented on PR #8779:
URL: 
https://github.com/apache/arrow-datafusion/pull/8779#issuecomment-1883677052

   > I don't understand how that calculation can capture the size of the hash 
table without taking into account the sizes of keys and values. Maybe the `8` 
is the implicit size of the values for the hashset (e.g. `sizeof(u64)` == `8`) 🤔
   
   Maybe `8` is just because it 'require 1/8 buckets to be empty (87.5% load)', 
we will divide it by `7` later. 
https://github.com/rust-lang/hashbrown/blob/f2e62124cd947b5e2309dd6a24c7e422932aae97/src/raw/mod.rs#L206-L211
   
   And the size of values are calculated later, here is when using `sizeof(u64) 
+ sizeof(u64) 
`https://github.com/apache/arrow-datafusion/blob/819d3577872a082f2aea7a68ae83d68534049662/datafusion/physical-plan/src/joins/hash_join.rs#L745-L750C1
   
   If this function just estimate the buckets, it will not use the 'key' and 
'value'.
   If this function will calculate the whole size of a hashtable/hashset, it 
will use use 'key' and 'value', but if this, it seems that 'hash_join.rs' can't 
use this function easily. 🤔
   


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