From c6eb592b398883929023945bad9c59b851512472 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Fri, 27 Oct 2023 00:56:03 +0800 Subject: [PATCH] Add some logs about join build (#8258) (#8260) close pingcap/tiflash#8257 --- dbms/src/Interpreters/Join.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index d73be4cf622..89afc5f4191 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -1747,12 +1747,15 @@ bool Join::finishOneBuild(size_t stream_index) void Join::finalizeBuild() { - std::unique_lock lock(build_probe_mutex); - if (hash_join_spill_context->getBuildSpiller()) - hash_join_spill_context->getBuildSpiller()->finishSpill(); - assert(active_build_threads == 0); - build_finished = true; - build_cv.notify_all(); + { + std::unique_lock lock(build_probe_mutex); + if (hash_join_spill_context->getBuildSpiller()) + hash_join_spill_context->getBuildSpiller()->finishSpill(); + assert(active_build_threads == 0); + build_finished = true; + build_cv.notify_all(); + } + LOG_INFO(log, "build finalize with {} entries from {} rows.", getTotalRowCount(), getTotalBuildInputRows()); } void Join::workAfterBuildFinish(size_t stream_index)