diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index a2972b82d13..219f6052134 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -899,8 +899,7 @@ void Aggregator::spill(AggregatedDataVariants & data_variants, size_t thread_num data_variants.aggregates_pools = Arenas(1, std::make_shared()); data_variants.aggregates_pool = data_variants.aggregates_pools.back().get(); data_variants.without_key = nullptr; - auto size_bytes = data_variants.bytesCount(); - agg_spill_context->updatePerThreadRevocableMemory(data_variants.revokableBytes(), thread_num); + agg_spill_context->updatePerThreadRevocableMemory(data_variants.revocableBytes(), thread_num); } template diff --git a/dbms/src/Interpreters/Aggregator.h b/dbms/src/Interpreters/Aggregator.h index 5c284cef46b..4cb2b70c643 100644 --- a/dbms/src/Interpreters/Aggregator.h +++ b/dbms/src/Interpreters/Aggregator.h @@ -724,7 +724,7 @@ struct AggregatedDataVariants : private boost::noncopyable } } - size_t revokableBytes() const + size_t revocableBytes() const { if (empty()) return 0; diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index c221fbb22a7..396307da91d 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -444,7 +444,7 @@ void Join::insertFromBlock(const Block & block, size_t stream_index) const auto & join_partition = partitions[i]; auto partition_lock = join_partition->lockPartition(); partitions[i]->insertBlockForBuild(std::move(dispatch_blocks[i])); - if (hash_join_spill_context->updatePartitionRevocableMemory(force_spill_partition_blocks, i, join_partition->revokableBytes())) + if (hash_join_spill_context->updatePartitionRevocableMemory(force_spill_partition_blocks, i, join_partition->revocableBytes())) blocks_to_spill = join_partition->trySpillBuildPartition(partition_lock); else stored_block = join_partition->getLastBuildBlock(); @@ -457,7 +457,7 @@ void Join::insertFromBlock(const Block & block, size_t stream_index) { join_partition->addMemoryUsage(byte_after_insert - byte_before_insert); } - auto ret = hash_join_spill_context->updatePartitionRevocableMemory(force_spill_partition_blocks, i, join_partition->revokableBytes()); + auto ret = hash_join_spill_context->updatePartitionRevocableMemory(force_spill_partition_blocks, i, join_partition->revocableBytes()); /// todo remove this after query level memory control RUNTIME_CHECK_MSG(ret != true, "Join spill should not triggered here"); continue; @@ -1903,7 +1903,7 @@ void Join::dispatchProbeBlock(Block & block, PartitionBlocks & partition_blocks_ if (getPartitionSpilled(i)) { partitions[i]->insertBlockForProbe(std::move(partition_blocks[i])); - if (hash_join_spill_context->updatePartitionRevocableMemory(false, i, partitions[i]->revokableBytes())) + if (hash_join_spill_context->updatePartitionRevocableMemory(false, i, partitions[i]->revocableBytes())) blocks_to_spill = partitions[i]->trySpillProbePartition(partition_lock); need_spill = true; } diff --git a/dbms/src/Interpreters/JoinPartition.h b/dbms/src/Interpreters/JoinPartition.h index 0ddda689750..9380536a4ae 100644 --- a/dbms/src/Interpreters/JoinPartition.h +++ b/dbms/src/Interpreters/JoinPartition.h @@ -142,7 +142,7 @@ class JoinPartition return pool; } size_t getMemoryUsage() const { return memory_usage; } - size_t revokableBytes() const + size_t revocableBytes() const { if (build_partition.rows > 0 || probe_partition.rows > 0) return memory_usage;