This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1caaeb8fe8fa521f2bb458bd76cef49cbd1f830b
Author: Mryange <[email protected]>
AuthorDate: Thu Sep 14 16:41:01 2023 +0800

    [fix](profile) move probe time to pull and add LoopGenerateJoin time #24302
---
 be/src/vec/exec/join/vnested_loop_join_node.cpp | 6 +++---
 be/src/vec/exec/join/vnested_loop_join_node.h   | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/be/src/vec/exec/join/vnested_loop_join_node.cpp 
b/be/src/vec/exec/join/vnested_loop_join_node.cpp
index 9b224efa0d..b1267831b3 100644
--- a/be/src/vec/exec/join/vnested_loop_join_node.cpp
+++ b/be/src/vec/exec/join/vnested_loop_join_node.cpp
@@ -150,7 +150,7 @@ Status VNestedLoopJoinNode::prepare(RuntimeState* state) {
     _num_build_side_columns = child(1)->row_desc().num_materialized_slots();
     RETURN_IF_ERROR(VExpr::prepare(_output_expr_ctxs, state, 
*_intermediate_row_desc));
     RETURN_IF_ERROR(VExpr::prepare(_filter_src_expr_ctxs, state, 
child(1)->row_desc()));
-
+    _loop_join_timer = ADD_CHILD_TIMER(_probe_phase_profile, 
"LoopGenerateJoin", "ProbeTime");
     _construct_mutable_join_block();
     return Status::OK();
 }
@@ -265,9 +265,7 @@ Status 
VNestedLoopJoinNode::_fresh_left_block(doris::RuntimeState* state) {
 
 Status VNestedLoopJoinNode::get_next(RuntimeState* state, Block* block, bool* 
eos) {
     SCOPED_TIMER(_runtime_profile->total_time_counter());
-    SCOPED_TIMER(_probe_timer);
     RETURN_IF_CANCELLED(state);
-
     while (need_more_input_data()) {
         RETURN_IF_ERROR(_fresh_left_block(state));
         push(state, &_left_block, _left_side_eos);
@@ -667,6 +665,7 @@ void VNestedLoopJoinNode::_release_mem() {
 }
 
 Status VNestedLoopJoinNode::pull(RuntimeState* state, vectorized::Block* 
block, bool* eos) {
+    SCOPED_TIMER(_probe_timer);
     if (_is_output_left_side_only) {
         RETURN_IF_ERROR(_build_output_block(&_left_block, block));
         *eos = _left_side_eos;
@@ -700,6 +699,7 @@ Status VNestedLoopJoinNode::pull(RuntimeState* state, 
vectorized::Block* block,
                                                  set_build_side_flag, 
set_probe_side_flag>(
                         state, join_op_variants);
             };
+            SCOPED_TIMER(_loop_join_timer);
             RETURN_IF_ERROR(std::visit(func, _join_op_variants,
                                        make_bool_variant(_match_all_build || 
_is_right_semi_anti),
                                        make_bool_variant(_match_all_probe || 
_is_left_semi_anti)));
diff --git a/be/src/vec/exec/join/vnested_loop_join_node.h 
b/be/src/vec/exec/join/vnested_loop_join_node.h
index 931db5f7f1..4df7c76697 100644
--- a/be/src/vec/exec/join/vnested_loop_join_node.h
+++ b/be/src/vec/exec/join/vnested_loop_join_node.h
@@ -259,7 +259,8 @@ private:
     std::stack<uint16_t> _build_offset_stack;
     std::stack<uint16_t> _probe_offset_stack;
     VExprContextSPtrs _join_conjuncts;
-
+    RuntimeProfile::Counter* _loop_join_timer;
+    template <typename Parent>
     friend struct RuntimeFilterBuild;
 };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to