Skip to content

Commit

Permalink
[refactor](profile) refactor join node profile when build side shared…
Browse files Browse the repository at this point in the history
… hash table (apache#24785)

refactor join node profile when build side shared hash table
  • Loading branch information
zhangstar333 authored Sep 25, 2023
1 parent 312576b commit c9ef5ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions be/src/vec/exec/join/vhash_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,12 @@ Status HashJoinNode::prepare(RuntimeState* state) {

// Build phase
auto record_profile = _should_build_hash_table ? _build_phase_profile : faker_runtime_profile();
_build_table_timer = ADD_CHILD_TIMER(_build_phase_profile, "BuildTableTime", "BuildTime");
_build_get_next_timer = ADD_TIMER(record_profile, "BuildGetNextTime");
_build_timer = ADD_TIMER(record_profile, "BuildTime");
_build_rows_counter = ADD_COUNTER(record_profile, "BuildRows", TUnit::UNIT);
_build_table_timer = ADD_CHILD_TIMER(record_profile, "BuildTableTime", "BuildTime");
_build_side_merge_block_timer =
ADD_CHILD_TIMER(_build_phase_profile, "BuildSideMergeBlockTime", "BuildTime");
ADD_CHILD_TIMER(record_profile, "BuildSideMergeBlockTime", "BuildTime");
_build_table_insert_timer = ADD_TIMER(record_profile, "BuildTableInsertTime");
_build_expr_call_timer = ADD_TIMER(record_profile, "BuildExprCallTime");
_build_table_expanse_timer = ADD_TIMER(record_profile, "BuildTableExpanseTime");
Expand Down Expand Up @@ -935,8 +938,7 @@ Status HashJoinNode::sink(doris::RuntimeState* state, vectorized::Block* in_bloc
} else if (!_should_build_hash_table) {
DCHECK(_shared_hashtable_controller != nullptr);
DCHECK(_shared_hash_table_context != nullptr);
auto wait_timer =
ADD_CHILD_TIMER(_build_phase_profile, "WaitForSharedHashTableTime", "BuildTime");
auto wait_timer = ADD_TIMER(_build_phase_profile, "WaitForSharedHashTableTime");
SCOPED_TIMER(wait_timer);
RETURN_IF_ERROR(
_shared_hashtable_controller->wait_for_signal(state, _shared_hash_table_context));
Expand Down
3 changes: 0 additions & 3 deletions be/src/vec/exec/join/vjoin_node_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ Status VJoinNodeBase::prepare(RuntimeState* state) {
RETURN_IF_ERROR(ExecNode::prepare(state));
runtime_profile()->add_info_string("JoinType", to_string(_join_op));
_build_phase_profile = runtime_profile()->create_child("BuildPhase", true, true);
_build_get_next_timer = ADD_TIMER(_build_phase_profile, "BuildGetNextTime");
_build_timer = ADD_TIMER(_build_phase_profile, "BuildTime");
_build_rows_counter = ADD_COUNTER(_build_phase_profile, "BuildRows", TUnit::UNIT);

_probe_phase_profile = runtime_profile()->create_child("ProbePhase", true, true);
_probe_timer = ADD_TIMER(_probe_phase_profile, "ProbeTime");
Expand Down
3 changes: 3 additions & 0 deletions be/src/vec/exec/join/vnested_loop_join_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ Status VNestedLoopJoinNode::init(const TPlanNode& tnode, RuntimeState* state) {
Status VNestedLoopJoinNode::prepare(RuntimeState* state) {
SCOPED_TIMER(_runtime_profile->total_time_counter());
RETURN_IF_ERROR(VJoinNodeBase::prepare(state));
_build_get_next_timer = ADD_TIMER(_build_phase_profile, "BuildGetNextTime");
_build_timer = ADD_TIMER(_build_phase_profile, "BuildTime");
_build_rows_counter = ADD_COUNTER(_build_phase_profile, "BuildRows", TUnit::UNIT);
// pre-compute the tuple index of build tuples in the output row
int num_build_tuples = child(1)->row_desc().tuple_descriptors().size();

Expand Down

0 comments on commit c9ef5ef

Please sign in to comment.