From b08e727aef1f7509b5d6409c824f19660b14dab5 Mon Sep 17 00:00:00 2001 From: Konstantin Bogdanov Date: Tue, 17 Sep 2024 19:02:10 +0200 Subject: [PATCH] Count allocated bytes from scratch after rerange --- src/Interpreters/HashJoin/HashJoin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Interpreters/HashJoin/HashJoin.cpp b/src/Interpreters/HashJoin/HashJoin.cpp index 9a1bfe2d408..dfc41a93417 100644 --- a/src/Interpreters/HashJoin/HashJoin.cpp +++ b/src/Interpreters/HashJoin/HashJoin.cpp @@ -1430,6 +1430,10 @@ void HashJoin::tryRerangeRightTableDataImpl(Map & map [[maybe_unused]]) visit_rows_map(sorted_blocks, map); doDebugAsserts(); data->blocks.swap(sorted_blocks); + size_t new_blocks_allocated_size = 0; + for (const auto & block : data->blocks) + new_blocks_allocated_size += block.allocatedBytes(); + data->blocks_allocated_size = new_blocks_allocated_size; doDebugAsserts(); } }