Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion datafusion/physical-plan/src/joins/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@ fn append_probe_indices_in_order(
/// Metrics for build & probe joins
#[derive(Clone, Debug)]
pub(crate) struct BuildProbeJoinMetrics {
// Keep these metric descriptions in sync with docs/source/user-guide/metrics.md.
pub(crate) baseline: BaselineMetrics,
/// Total time for collecting build-side of join
pub(crate) build_time: metrics::Time,
Expand All @@ -1773,7 +1774,7 @@ pub(crate) struct BuildProbeJoinMetrics {
pub(crate) input_batches: metrics::Count,
/// Number of rows consumed by probe-side this operator
pub(crate) input_rows: metrics::Count,
/// Fraction of probe rows that found more than one match
/// Fraction of probe rows that found at least one match
pub(crate) probe_hit_rate: metrics::RatioMetrics,
/// Average number of build matches per matched probe row
pub(crate) avg_fanout: metrics::RatioMetrics,
Expand Down
19 changes: 19 additions & 0 deletions docs/source/user-guide/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ DataFusion operators expose runtime metrics so you can understand where time is
| ----------- | ----------------------------------------------------------------- |
| selectivity | Selectivity of the filter, calculated as output_rows / input_rows |

### HashJoinExec

`HashJoinExec` also exposes the common `BaselineMetrics`. Its
`elapsed_compute` metric is the sum of the build-side collection time and the
probe-side join time.

| Metric | Description |
| ----------------------- | -------------------------------------------------------------------------------------------- |
| build_time | Total time spent collecting and building the build side of the join. |
| build_input_batches | Number of input batches consumed from the build side. |
| build_input_rows | Number of input rows consumed from the build side. |
| build_mem_used | Peak memory used by the build side, in bytes. |
| join_time | Total time spent joining probe-side batches against the build side. |
| input_batches | Number of input batches consumed from the probe side. |
| input_rows | Number of input rows consumed from the probe side. |
| probe_hit_rate | Fraction of probe-side rows that matched at least one build-side row. |
| avg_fanout | Average number of build-side matches per matched probe-side row. |
| array_map_created_count | Number of times `HashJoinExec` created an `ArrayMap` for perfect hash join lookup execution. |

## TODO

Add metrics for the remaining operators