2010YOUY01 opened a new issue, #18409:
URL: https://github.com/apache/datafusion/issues/18409

   ### Is your feature request related to a problem or challenge?
   
   I think there are two metrics that are useful to find anti-patterns when 
processing data with Hash Joins:
   
   - probe_hit_rate = fraction of probe rows that found ≥1 match
   - avg_fanout = average number of build matches per matched probe row
   
   ### Example
   In `datafusion-cli`
   ```
   > set datafusion.explain.analyze_level = summary;
   0 row(s) fetched.
   Elapsed 0.000 seconds.
   
   > explain analyze select *
   from generate_series(10) as t1(a)
   join generate_series(20) as t2(b)
   on t1.a=t2.b;
   ```
   Assuming t1 is the build side and t2 is the probe side, around half of the 
probe side rows will have match in the hash table built with `t1`, and each 
match will output exactly 1 output row. So the metric will be calculated as 
`HashJoinExec ...metrics=[...probe_hit_rate=50%, avg_fanout=1...`
   
   ### Describe the solution you'd like
   
   Support `probe_hit_rate` and `avg_fanout` in Hash Join executor.
   
   Reference PR: https://github.com/apache/datafusion/pull/18406
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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