You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by cs...@apache.org on 2021/08/27 13:41:33 UTC
[impala] 01/03: IMPALA-7635: Reducing HashTable size by packing
it's buckets efficiently.
This is an automated email from the ASF dual-hosted git repository.
csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 2040b2621f73de4dfaba80dd938221758952183f
Author: Amogh Margoor <am...@cloudera.com>
AuthorDate: Sun Jun 6 20:20:52 2021 +0100
IMPALA-7635: Reducing HashTable size by packing it's buckets efficiently.
HashTable implementation in Impala comprises of contiguous array
of Buckets and each Bucket contains either data or pointer to
linked list of duplicate entries named DuplicateNode.
These are the structures of Bucket and DuplicateNode:
struct DuplicateNode {
bool matched;
DuplicateNode* next;
HtData htdata;
};
struct Bucket {
bool filled;
bool matched;
bool hasDuplicates;
uint32_t hash;
union {
HtData htdata;
DuplicateNode* duplicates;
} bucketData;
};
Size of Bucket is currently 16 bytes and size of DuplicateNode is
24 bytes. If we can remove the booleans from both struct size of
Bucket would reduce to 12 bytes and DuplicateNode will be 16 bytes.
One of the ways we can remove booleans is to fold it into pointers
already part of struct. Pointers store addresses and on
architectures like x86 and ARM the linear address is only 48 bits
long. With level 5 paging Intel is planning to expand it to 57-bit
long which means we can use most significant 7 bits i.e., 58 to 64
bits to store these booleans. This patch reduces the size of Bucket
and DuplicateNode by implementing this folding. However, there is
another requirement regarding Size of Bucket to be power of 2 and
also for the number of buckets in Hash table to be power of 2.
These requirements are for the following reasons:
1. Memory Allocator allocates memory in power of 2 to avoid
internal fragmentation. Hence, num of buckets * sizeof(Buckets)
should be power of 2.
2. Number of buckets being power of 2 enables faster modulo
operation i.e., instead of slow modulo: (hash % N), faster
(hash & (N-1)) can be used.
Due to this, 4 bytes 'hash' field from Bucket is removed and
stored separately in new array hash_array_ in HashTable.
This ensures sizeof(Bucket) is 8 which is power of 2.
New Classes:
------------
As a part of patch, TaggedPointer is introduced which is a template
class to store a pointer and 7-bit tag together in 64 bit integer.
This structure contains the ownership of the pointer and will take care
of allocation and deallocation of the object being pointed to.
However derived classes can opt out of the ownership of the object
and let the client manage it. It's derived classes for Bucket and
DuplicateNode do the same. These classes are TaggedBucketData and
TaggedDuplicateNode.
Benchmark:
----------
As a part of this patch a new Micro Benchmark for HashTable has
been introduced, which will help in measuring these:
1. Runtime for building hash table and probing it.
2. Memory consumed after building the Table.
This would help measuring the impact of changes to the HashTable's
data structure and algorithm.
Saw 25-30% reduction in memory consumed and no significant
difference in performance (0.91X-1.2X).
Other Benchmarks:
1. Billion row Synthetic benchmark on single node, single daemon:
a. 2-3% improvement in Join GEOMEAN for Probe benchmark.
b. 17% and 21% reduction in PeakMemoryUsage and
CumulativeBytes allocated respectively
2. TPCH-42: 0-1.5% improvement in GEOMEAN runtime
Change-Id: I72912ae9353b0d567a976ca712d2d193e035df9b
Reviewed-on: http://gerrit.cloudera.org:8080/17592
Reviewed-by: Zoltan Borok-Nagy <bo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
be/src/benchmarks/CMakeLists.txt | 1 +
be/src/benchmarks/hash-table-benchmark.cc | 391 +++++++++++++++++++++
be/src/exec/grouping-aggregator-ir.cc | 15 +-
be/src/exec/grouping-aggregator-partition.cc | 4 +-
be/src/exec/grouping-aggregator.cc | 8 +-
be/src/exec/hash-table-test.cc | 6 +
be/src/exec/hash-table.cc | 63 +++-
be/src/exec/hash-table.h | 229 +++++++++---
be/src/exec/hash-table.inline.h | 200 ++++++-----
be/src/util/CMakeLists.txt | 2 +
be/src/util/benchmark.cc | 6 +-
be/src/util/benchmark.h | 8 +-
be/src/util/tagged-ptr-test.cc | 169 +++++++++
be/src/util/tagged-ptr.h | 139 ++++++++
.../org/apache/impala/planner/PlannerContext.java | 6 +-
.../org/apache/impala/planner/CardinalityTest.java | 18 +-
...k-join-detection-hdfs-num-rows-est-enabled.test | 4 +-
.../queries/PlannerTest/fk-pk-join-detection.test | 6 +-
.../queries/PlannerTest/max-row-size.test | 42 +--
.../queries/PlannerTest/resource-requirements.test | 160 ++++-----
.../PlannerTest/spillable-buffer-sizing.test | 58 +--
.../queries/PlannerTest/tpcds/tpcds-q01.test | 44 +--
.../queries/PlannerTest/tpcds/tpcds-q04.test | 40 +--
.../queries/PlannerTest/tpcds/tpcds-q05.test | 2 +-
.../queries/PlannerTest/tpcds/tpcds-q06.test | 36 +-
.../queries/PlannerTest/tpcds/tpcds-q07.test | 36 +-
.../queries/PlannerTest/tpcds/tpcds-q11.test | 44 +--
.../queries/PlannerTest/tpcds/tpcds-q12.test | 2 +-
.../queries/PlannerTest/tpcds/tpcds-q14a.test | 32 +-
.../queries/PlannerTest/tpcds/tpcds-q15.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q16.test | 24 +-
.../queries/PlannerTest/tpcds/tpcds-q17.test | 16 +-
.../queries/PlannerTest/tpcds/tpcds-q18.test | 24 +-
.../queries/PlannerTest/tpcds/tpcds-q19.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q20.test | 2 +-
.../queries/PlannerTest/tpcds/tpcds-q22.test | 32 +-
.../queries/PlannerTest/tpcds/tpcds-q23a.test | 82 ++---
.../queries/PlannerTest/tpcds/tpcds-q23b.test | 82 ++---
.../queries/PlannerTest/tpcds/tpcds-q24a.test | 22 +-
.../queries/PlannerTest/tpcds/tpcds-q24b.test | 22 +-
.../queries/PlannerTest/tpcds/tpcds-q25.test | 18 +-
.../queries/PlannerTest/tpcds/tpcds-q26.test | 28 +-
.../queries/PlannerTest/tpcds/tpcds-q27.test | 36 +-
.../queries/PlannerTest/tpcds/tpcds-q29.test | 18 +-
.../queries/PlannerTest/tpcds/tpcds-q34.test | 6 +-
.../queries/PlannerTest/tpcds/tpcds-q35a.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q38.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q39a.test | 46 +--
.../queries/PlannerTest/tpcds/tpcds-q39b.test | 46 +--
.../queries/PlannerTest/tpcds/tpcds-q45.test | 48 +--
.../queries/PlannerTest/tpcds/tpcds-q46.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q47.test | 24 +-
.../queries/PlannerTest/tpcds/tpcds-q48.test | 6 +-
.../queries/PlannerTest/tpcds/tpcds-q50.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q51.test | 20 +-
.../queries/PlannerTest/tpcds/tpcds-q56.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q57.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q58.test | 50 +--
.../queries/PlannerTest/tpcds/tpcds-q60.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q61.test | 10 +-
.../queries/PlannerTest/tpcds/tpcds-q64.test | 58 +--
.../queries/PlannerTest/tpcds/tpcds-q66.test | 10 +-
.../queries/PlannerTest/tpcds/tpcds-q67.test | 30 +-
.../queries/PlannerTest/tpcds/tpcds-q68.test | 28 +-
.../queries/PlannerTest/tpcds/tpcds-q72.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q73.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q74.test | 36 +-
.../queries/PlannerTest/tpcds/tpcds-q78.test | 2 +-
.../queries/PlannerTest/tpcds/tpcds-q80.test | 16 +-
.../queries/PlannerTest/tpcds/tpcds-q82.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q83.test | 60 ++--
.../queries/PlannerTest/tpcds/tpcds-q85.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q87.test | 26 +-
.../queries/PlannerTest/tpcds/tpcds-q95.test | 8 +-
.../queries/PlannerTest/tpcds/tpcds-q97.test | 10 +-
.../queries/PlannerTest/tpcds/tpcds-q98.test | 16 +-
.../queries/PlannerTest/tpch-all.test | 40 +--
.../queries/PlannerTest/tpch-kudu.test | 30 +-
.../queries/PlannerTest/tpch-nested.test | 6 +-
.../QueryTest/spilling-broadcast-joins.test | 2 +-
.../queries/QueryTest/spilling.test | 2 +-
81 files changed, 1976 insertions(+), 1049 deletions(-)
diff --git a/be/src/benchmarks/CMakeLists.txt b/be/src/benchmarks/CMakeLists.txt
index c09e71e..f436cef 100644
--- a/be/src/benchmarks/CMakeLists.txt
+++ b/be/src/benchmarks/CMakeLists.txt
@@ -61,5 +61,6 @@ ADD_BE_BENCHMARK(thread-create-benchmark)
ADD_BE_BENCHMARK(tuple-layout-benchmark)
ADD_BE_BENCHMARK(convert-timestamp-benchmark)
ADD_BE_BENCHMARK(date-benchmark)
+ADD_BE_BENCHMARK(hash-table-benchmark)
target_link_libraries(hash-benchmark Experiments)
diff --git a/be/src/benchmarks/hash-table-benchmark.cc b/be/src/benchmarks/hash-table-benchmark.cc
new file mode 100644
index 0000000..525f83c
--- /dev/null
+++ b/be/src/benchmarks/hash-table-benchmark.cc
@@ -0,0 +1,391 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include <boost/scoped_ptr.hpp>
+#include "exec/hash-table.inline.h"
+#include "exprs/scalar-expr-evaluator.h"
+#include "exprs/slot-ref.h"
+#include "gtest/gtest.h"
+#include "runtime/bufferpool/buffer-pool.h"
+#include "runtime/bufferpool/reservation-tracker.h"
+#include "runtime/mem-pool.h"
+#include "runtime/mem-tracker.h"
+#include "runtime/runtime-state.h"
+#include "runtime/test-env.h"
+#include "service/fe-support.h"
+#include "util/benchmark.h"
+#include "util/cpu-info.h"
+#include "util/runtime-profile-counters.h"
+
+using namespace impala;
+using namespace std;
+
+// Sample Benchmark Results:
+//
+// Machine Info: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
+// Note: Benchmark name are in format <name>_XX_YY:
+// name represents the name of benchmark (probe|build|memory).
+// XX represents the number of rows in the dataset.
+// YY represents the percentage of unique values in dataset.
+// Runtime Benchmark
+// -----------------
+// 21/06/30 08:44:20 INFO util.JvmPauseMonitor: Starting JVM pause monitor
+// Hash Table Build: Function iters/ms 10%ile 50%ile 90%ile 10%ile 50%ile 90%ile
+// (relative) (relative) (relative)
+// ---------------------------------------------------------------------------------------------------------
+// build_65536_100 4.04 4.35 4.35 1X 1X 1X
+
+// build_65536_60 8.27 9.09 9.26 1X 1X 1X
+
+// build_65536_20 8.78 9.0 9.3 1X 1X 1X
+
+// build_262144_100 0.386 0.407 0.407 1X 1X 1X
+
+// build_262144_60 0.316 0.407 0.415 1X 1X 1X
+
+// build_262144_20 0.295 0.31 0.316 1X 1X 1X
+
+// Hash Table Probe: Function iters/ms 10%ile 50%ile 90%ile 10%ile 50%ile 90%ile
+// (relative) (relative) (relative)
+// ---------------------------------------------------------------------------------------------------------
+// probe_65536_100 2.64 2.64 2.69 1X 1X 1X
+
+// probe_65536_60 5.1 5.96 6.08 1X 1X 1X
+
+// probe_65536_20 6.2 6.35 6.35 1X 1X 1X
+
+// probe_262144_100 0.233 0.237 0.237 1X 1X 1X
+
+// probe_262144_60 0.237 0.25 0.25 1X 1X 1X
+
+// probe_262144_20 0.255 0.259 0.259 1X 1X 1X
+
+// probe_65536_absentkeys 20.1 21.6 21.6 1X 1X 1X
+
+// probe_262144_absentkeys 0.727 0.741 0.741 1X 1X 1X
+
+// Memory Benchmark
+// ----------------
+// Hash Table Memory Consumption: Function Bytes Consumed
+// ----------------------------------------------------------------------
+// memory_1048576_100 12582912
+// memory_1048576_60 16777212
+// memory_1048576_20 20971512
+// memory_4194304_100 50331648
+// memory_4194304_60 67108868
+// memory_4194304_20 83886088
+
+namespace htbenchmark {
+
+class TestCtx {
+ public:
+ TestCtx() : mem_pool_(&tracker_) {}
+ /// Temporary runtime environment for the hash table.
+ unique_ptr<TestEnv> test_env_;
+ RuntimeState* runtime_state_ = nullptr;
+
+ /// Data for HashTable
+ vector<TupleRow*> data;
+ /// Hash tables and associated clients - automatically closed in TearDown().
+ vector<BufferPool::ClientHandle*> clients_;
+ HashTable* hash_table_;
+ boost::scoped_ptr<HashTableCtx> hash_context_;
+ vector<ScalarExpr*> build_exprs_;
+ vector<ScalarExpr*> probe_exprs_;
+ ObjectPool pool_;
+ /// A dummy MemTracker used for exprs and other things we don't need to have limits on.
+ MemTracker tracker_;
+ MemPool mem_pool_;
+ int initial_num_buckets;
+ void SetUp(int num_buckets) {
+ CreateTestEnv();
+ initial_num_buckets = num_buckets;
+ bool ht_success = CreateHashTable();
+ CHECK(ht_success) << "Creation of HashTable failed";
+ RowDescriptor rd;
+ ScalarExpr* build_expr = pool_.Add(new SlotRef(ColumnType(TYPE_INT), 1, false));
+ Status status = ((SlotRef*)build_expr)->Init(rd, true, nullptr);
+ CHECK(status.ok());
+ build_exprs_.push_back(build_expr);
+ ScalarExpr* probe_expr = pool_.Add(new SlotRef(ColumnType(TYPE_INT), 1, false));
+ status = ((SlotRef*)probe_expr)->Init(rd, true, nullptr);
+ CHECK(status.ok());
+ probe_exprs_.push_back(probe_expr);
+ status = HashTableCtx::Create(&pool_, runtime_state_, build_exprs_, probe_exprs_,
+ false /* !stores_nulls_ */, vector<bool>(build_exprs_.size(), false), 1, 0, 1,
+ &mem_pool_, &mem_pool_, &mem_pool_, &hash_context_);
+ CHECK(status.ok());
+ }
+ void TearDown() {
+ ScalarExpr::Close(build_exprs_);
+ ScalarExpr::Close(probe_exprs_);
+ hash_table_->Close();
+ hash_context_->Close(runtime_state_);
+ for (BufferPool::ClientHandle* client : clients_) {
+ test_env_->exec_env()->buffer_pool()->DeregisterClient(client);
+ }
+ clients_.clear();
+ runtime_state_ = nullptr;
+ mem_pool_.FreeAll();
+ pool_.Clear();
+ }
+ /// Initialize test_env_ and runtime_state_ with the given page size and capacity
+ /// for the given number of pages. If test_env_ was already created, then re-creates it.
+ void CreateTestEnv(int64_t min_page_size = 64 * 1024,
+ int64_t buffer_bytes_limit = 4L * 1024 * 1024 * 1024) {
+ test_env_.reset(new TestEnv());
+ test_env_->SetBufferPoolArgs(min_page_size, buffer_bytes_limit);
+ Status status = test_env_->Init();
+ CHECK(status.ok());
+
+ TQueryOptions query_options;
+ query_options.__set_default_spillable_buffer_size(min_page_size);
+ query_options.__set_min_spillable_buffer_size(min_page_size);
+ query_options.__set_buffer_pool_limit(buffer_bytes_limit);
+ // Also initializes runtime_state_
+ status = test_env_->CreateQueryState(0, &query_options, &runtime_state_);
+ CHECK(status.ok());
+ }
+ /// Construct hash table and buffer pool client.
+ /// Created objects and resources (e.g. reservations) are automatically freed
+ /// in TearDown().
+ bool CreateHashTable(int64_t block_size = 8 * 1024 * 1024, int max_num_blocks = 100,
+ int initial_reserved_blocks = 10, int64_t suballocator_buffer_len = 64 * 1024) {
+ ExecEnv* exec_env = test_env_->exec_env();
+ BufferPool* buffer_pool = exec_env->buffer_pool();
+ RuntimeProfile* profile = RuntimeProfile::Create(&pool_, "ht");
+
+ // Set up memory tracking for the hash table.
+ MemTracker* client_tracker =
+ pool_.Add(new MemTracker(-1, "client", runtime_state_->instance_mem_tracker()));
+ int64_t initial_reservation_bytes = block_size * initial_reserved_blocks;
+ int64_t max_reservation_bytes = block_size * max_num_blocks;
+
+ // Set up the memory allocator.
+ BufferPool::ClientHandle* client = pool_.Add(new BufferPool::ClientHandle);
+ clients_.push_back(client);
+ Status status = buffer_pool->RegisterClient("htbenchmark", nullptr,
+ runtime_state_->instance_buffer_reservation(), client_tracker,
+ max_reservation_bytes, profile, client);
+ if (!status.ok()) {
+ std::cout << "Registering client to buffer pool failed" << std::endl;
+ return false;
+ }
+ bool success = client->IncreaseReservation(initial_reservation_bytes);
+ if (!success) {
+ std::cout << "Client increasing reservation failed" << std::endl;
+ return false;
+ }
+ Suballocator* allocator =
+ pool_.Add(new Suballocator(buffer_pool, client, suballocator_buffer_len));
+
+ int64_t max_num_buckets = 1L << 31;
+ hash_table_ = pool_.Add(HashTable::Create(
+ allocator, true, 1, nullptr, max_num_buckets, initial_num_buckets));
+ status = hash_table_->Init(&success);
+ if (!(status.ok() && success)) {
+ std::cout << "HashTable Init failed" << std::endl;
+ }
+ return status.ok() && success;
+ }
+ TupleRow* CreateTupleRow(int32_t val) {
+ uint8_t* tuple_row_mem = mem_pool_.Allocate(sizeof(int32_t*));
+ Tuple* tuple_mem = Tuple::Create(sizeof(char) + sizeof(int32_t), &mem_pool_);
+ *reinterpret_cast<int32_t*>(tuple_mem->GetSlot(1)) = val;
+ tuple_mem->SetNotNull(NullIndicatorOffset(0, 1));
+ TupleRow* row = reinterpret_cast<TupleRow*>(tuple_row_mem);
+ row->SetTuple(0, tuple_mem);
+ return row;
+ }
+ void CreateDataSet(int num_buckets, int unique_percent, int dup = 2) {
+ int u_idx = (num_buckets * unique_percent) / 100;
+ TupleRow* row;
+ for (int i = 1; i <= u_idx; i++) {
+ row = CreateTupleRow(i);
+ data.push_back(row);
+ }
+ int count = u_idx;
+ for (int j = u_idx + 1; j <= num_buckets && count < num_buckets; j++) {
+ for (int i = 0; i < dup && count < num_buckets; i++) {
+ row = CreateTupleRow(j);
+ data.push_back(row);
+ count++;
+ }
+ }
+ }
+ void CreateAbsentKeysData(int num_buckets) {
+ data.clear();
+ TupleRow* row;
+ for (int i = 1; i <= num_buckets; i++) {
+ row = CreateTupleRow(num_buckets + i);
+ data.push_back(row);
+ }
+ }
+};
+
+void Probe(TestCtx* ctx, vector<TupleRow*>& pdata) {
+ HashTable* hTable = ctx->hash_table_;
+ HashTableCtx* ht_ctx = ctx->hash_context_.get();
+ HashTable::Iterator iter;
+ for (int i = 0; i < pdata.size(); i++) {
+ const TupleRow* row = pdata[i];
+ if (!ht_ctx->EvalAndHashProbe(row)) continue;
+ iter = hTable->FindProbeRow(ht_ctx);
+ }
+}
+
+void Build(TestCtx* ctx, vector<TupleRow*>& bdata) {
+ HashTable* ht = ctx->hash_table_;
+ HashTableCtx* ht_ctx = ctx->hash_context_.get();
+ for (int i = 0; i < bdata.size(); i++) {
+ TupleRow* row = bdata[i];
+ if (!ht_ctx->EvalAndHashBuild(row)) continue;
+ BufferedTupleStream::FlatRowPtr dummy_flat_row = nullptr;
+ Status status;
+ bool success = ht->Insert(ht_ctx, dummy_flat_row, row, &status);
+ CHECK(status.ok() && success) << "Inserting a tuple in HashTable failed";
+ }
+}
+
+namespace build {
+void SetUp(void* args) {
+ TestCtx* ctx = reinterpret_cast<TestCtx*>(args);
+ // Clear old tuples of hash table
+ ctx->hash_table_->Close();
+ bool got_memory = true;
+ Status status = ctx->hash_table_->Init(&got_memory);
+ CHECK(status.ok() && got_memory) << "HashTable Reinitialization failed";
+}
+void Benchmark(int batch_size, void* args) {
+ // batch_size is ignored. This is run just once.
+ TestCtx* ctx = reinterpret_cast<TestCtx*>(args);
+ Build(ctx, ctx->data);
+}
+}; // namespace build
+
+namespace probe {
+void Benchmark(int batch_size, void* args) {
+ // batch_size is ignored. This is run just once.
+ TestCtx* ctx = reinterpret_cast<TestCtx*>(args);
+ Probe(ctx, ctx->data);
+}
+}; // namespace probe
+}; // namespace htbenchmark
+
+using namespace htbenchmark;
+std::string ResultString(
+ vector<std::string> benchmark_names, vector<int64_t> memory_consumption) {
+ stringstream ss;
+ int function_out_width = 50;
+ int mem_width = 20;
+ int total_width = function_out_width + mem_width;
+ std::string name("Hash Table Memory Consumption");
+ ss << name << ":" << setw(function_out_width - name.size() - 1) << "Function"
+ << setw(mem_width) << "Bytes Consumed" << std::endl;
+ for (int i = 0; i < total_width; ++i) {
+ ss << '-';
+ }
+ ss << std::endl;
+ for (int i = 0; i < benchmark_names.size(); i++) {
+ ss << setw(function_out_width) << benchmark_names[i] << setw(mem_width)
+ << memory_consumption[i] << std::endl;
+ }
+ return ss.str();
+}
+
+int64_t GetMemoryBytesConsumed(HashTable* ht) {
+ int empty_buckets = ht->EmptyBuckets();
+ int64_t mem_size = ht->CurrentMemSize();
+ return mem_size - (empty_buckets * (HashTable::BUCKET_SIZE + 4));
+}
+
+int main(int argc, char** argv) {
+ impala::InitCommonRuntime(argc, argv, true, impala::TestInfo::BE_TEST);
+ impala::InitFeSupport();
+ /// Runtime Benchmark
+ std::cout << Benchmark::GetMachineInfo() << std::endl;
+ std::cout << "Note: Benchmark name are in format <name>_XX_YY:" << std::endl
+ << "name represents the name of benchmark (probe|build|memory)." << std::endl
+ << "XX represents the number of rows in the dataset." << std::endl
+ << "YY represents the percentage of unique values in dataset." << std::endl;
+ std::cout << "Runtime Benchmark" << std::endl;
+ std::cout << "-----------------" << std::endl;
+
+ Benchmark hash_table_build("Hash Table Build", false);
+ Benchmark hash_table_probe("Hash Table Probe", false);
+ vector<int> num_tuples{65536, 262144};
+ vector<int> unique_percent{100, 60, 20};
+ vector<TestCtx*> ctxs;
+ for (int num = 0; num < num_tuples.size(); num++) {
+ for (int up = 0; up < unique_percent.size(); up++) {
+ std::stringstream pname;
+ std::stringstream bname;
+ pname << "probe_" << num_tuples[num] << "_" << unique_percent[up];
+ bname << "build_" << num_tuples[num] << "_" << unique_percent[up];
+ TestCtx* ctx = new TestCtx();
+ ctx->SetUp(num_tuples[num]);
+ ctxs.push_back(ctx);
+ ctx->CreateDataSet(num_tuples[num], unique_percent[up]);
+ hash_table_build.AddBenchmark(bname.str(), build::Benchmark, (void*)ctx, -1);
+ hash_table_probe.AddBenchmark(pname.str(), probe::Benchmark, (void*)ctx, -1);
+ }
+ }
+
+ // Create Probe benchmark for Data not found in the table
+ for (int num = 0; num < num_tuples.size(); num++) {
+ TestCtx* ctx = new TestCtx();
+ ctx->SetUp(num_tuples[num]);
+ ctxs.push_back(ctx);
+ ctx->CreateDataSet(num_tuples[num], 10);
+ Build(ctx, ctx->data);
+ ctx->CreateAbsentKeysData(num_tuples[num]);
+ std::stringstream pname;
+ pname << "probe_" << num_tuples[num] << "_absentkeys";
+ hash_table_probe.AddBenchmark(pname.str(), probe::Benchmark, (void*)ctx, -1);
+ }
+ std::cout << hash_table_build.Measure(50, 10, build::SetUp) << std::endl;
+ std::cout << hash_table_probe.Measure() << std::endl;
+ // Cleanup contexts
+ for (TestCtx* ct : ctxs) {
+ ct->TearDown();
+ free(ct);
+ }
+
+ /// Memory Benchmark
+ std::cout << "Memory Benchmark" << std::endl;
+ std::cout << "----------------" << std::endl;
+ vector<std::string> benchmark_names;
+ vector<int64_t> memory_consumption;
+ num_tuples.clear();
+ num_tuples.push_back(1024 * 1024);
+ num_tuples.push_back(4 * 1024 * 1024);
+ for (int num = 0; num < num_tuples.size(); num++) {
+ for (int up = 0; up < unique_percent.size(); up++) {
+ std::stringstream bname;
+ bname << "memory_" << num_tuples[num] << "_" << unique_percent[up];
+ TestCtx ctx;
+ ctx.SetUp(num_tuples[num]);
+ ctx.CreateDataSet(num_tuples[num], unique_percent[up]);
+ Build(&ctx, ctx.data);
+ benchmark_names.push_back(bname.str());
+ memory_consumption.push_back(GetMemoryBytesConsumed(ctx.hash_table_));
+ ctx.TearDown();
+ }
+ }
+ std::cout << ResultString(benchmark_names, memory_consumption) << std::endl;
+ return 0;
+}
\ No newline at end of file
diff --git a/be/src/exec/grouping-aggregator-ir.cc b/be/src/exec/grouping-aggregator-ir.cc
index 18b5f5f..95e0b57 100644
--- a/be/src/exec/grouping-aggregator-ir.cc
+++ b/be/src/exec/grouping-aggregator-ir.cc
@@ -24,6 +24,8 @@
using namespace impala;
+typedef HashTable::BucketType BucketType;
+
template <bool AGGREGATED_ROWS>
Status GroupingAggregator::AddBatchImpl(RowBatch* batch,
TPrefetchMode::type prefetch_mode, HashTableCtx* __restrict__ ht_ctx,
@@ -110,7 +112,8 @@ Status GroupingAggregator::ProcessRow(
bool found;
// Find the appropriate bucket in the hash table. There will always be a free
// bucket because we checked the size above.
- HashTable::Iterator it = hash_tbl->FindBuildRowBucket(ht_ctx, &found);
+ HashTable::Iterator it =
+ hash_tbl->FindBuildRowBucket<BucketType::MATCH_UNSET>(ht_ctx, &found);
DCHECK(!it.AtEnd()) << "Hash table had no free buckets";
if (AGGREGATED_ROWS) {
// If the row is already an aggregate row, it cannot match anything in the
@@ -119,7 +122,8 @@ Status GroupingAggregator::ProcessRow(
DCHECK(!found);
} else if (found) {
// Row is already in hash table. Do the aggregation and we're done.
- UpdateTuple(dst_partition->agg_fn_evals.data(), it.GetTuple(), row);
+ UpdateTuple(
+ dst_partition->agg_fn_evals.data(), it.GetTuple<BucketType::MATCH_UNSET>(), row);
return Status::OK();
}
@@ -232,11 +236,12 @@ bool GroupingAggregator::TryAddToHashTable(HashTableCtx* __restrict__ ht_ctx,
DCHECK_EQ(hash_tbl, partition->hash_tbl.get());
DCHECK_GE(*remaining_capacity, 0);
bool found;
- // This is called from ProcessBatchStreaming() so the rows are not aggregated.
- HashTable::Iterator it = hash_tbl->FindBuildRowBucket(ht_ctx, &found);
Tuple* intermediate_tuple;
+ // This is called from ProcessBatchStreaming() so the rows are not aggregated.
+ HashTable::Iterator it =
+ hash_tbl->FindBuildRowBucket<BucketType::MATCH_UNSET>(ht_ctx, &found);
if (found) {
- intermediate_tuple = it.GetTuple();
+ intermediate_tuple = it.GetTuple<BucketType::MATCH_UNSET>();
} else if (*remaining_capacity == 0) {
return false;
} else {
diff --git a/be/src/exec/grouping-aggregator-partition.cc b/be/src/exec/grouping-aggregator-partition.cc
index 8837623..800c066 100644
--- a/be/src/exec/grouping-aggregator-partition.cc
+++ b/be/src/exec/grouping-aggregator-partition.cc
@@ -34,6 +34,8 @@
namespace impala {
+typedef HashTable::BucketType BucketType;
+
GroupingAggregator::Partition::~Partition() {
DCHECK(is_closed);
}
@@ -123,7 +125,7 @@ Status GroupingAggregator::Partition::SerializeStreamForSpilling() {
// could occupy it.
bool used_large_page_reservation = false;
while (!it.AtEnd()) {
- Tuple* tuple = it.GetTuple();
+ Tuple* tuple = it.GetTuple<BucketType::MATCH_UNSET>();
it.Next();
AggFnEvaluator::Serialize(agg_fn_evals, tuple);
TupleRow* row = reinterpret_cast<TupleRow*>(&tuple);
diff --git a/be/src/exec/grouping-aggregator.cc b/be/src/exec/grouping-aggregator.cc
index 93fc4ab..f77f0df 100644
--- a/be/src/exec/grouping-aggregator.cc
+++ b/be/src/exec/grouping-aggregator.cc
@@ -47,6 +47,8 @@
namespace impala {
+typedef HashTable::BucketType BucketType;
+
/// The minimum reduction factor (input rows divided by output rows) to grow hash tables
/// in a streaming preaggregation, given that the hash tables are currently the given
/// size or above. The sizes roughly correspond to hash table sizes where the bucket
@@ -315,7 +317,7 @@ Status GroupingAggregator::GetRowsFromPartition(
int row_idx = row_batch->AddRow();
TupleRow* row = row_batch->GetRow(row_idx);
- Tuple* intermediate_tuple = output_iterator_.GetTuple();
+ Tuple* intermediate_tuple = output_iterator_.GetTuple<BucketType::MATCH_UNSET>();
Tuple* output_tuple = GetOutputTuple(output_partition_->agg_fn_evals,
intermediate_tuple, row_batch->tuple_data_pool());
output_iterator_.Next();
@@ -401,7 +403,7 @@ void GroupingAggregator::CleanupHashTbl(
Tuple* dummy_dst = nullptr;
dummy_dst = Tuple::Create(output_tuple_desc_->byte_size(), tuple_pool_.get());
while (!it.AtEnd()) {
- Tuple* tuple = it.GetTuple();
+ Tuple* tuple = it.GetTuple<BucketType::MATCH_UNSET>();
AggFnEvaluator::Finalize(agg_fn_evals, tuple, dummy_dst);
it.Next();
// Free any expr result allocations to prevent them accumulating excessively.
@@ -409,7 +411,7 @@ void GroupingAggregator::CleanupHashTbl(
}
} else {
while (!it.AtEnd()) {
- Tuple* tuple = it.GetTuple();
+ Tuple* tuple = it.GetTuple<BucketType::MATCH_UNSET>();
AggFnEvaluator::Serialize(agg_fn_evals, tuple);
it.Next();
// Free any expr result allocations to prevent them accumulating excessively.
diff --git a/be/src/exec/hash-table-test.cc b/be/src/exec/hash-table-test.cc
index 456c0f8..6a23b04 100644
--- a/be/src/exec/hash-table-test.cc
+++ b/be/src/exec/hash-table-test.cc
@@ -741,4 +741,10 @@ TEST_F(HashTableTest, VeryLowMemTest) {
VeryLowMemTest(false);
}
+// Test to ensure the bucket size doesn't change accidentally.
+// On intentional changes to Bucket Size this test should be changed.
+TEST_F(HashTableTest, BucketSize) {
+ int bucket_size = HashTable::BUCKET_SIZE;
+ EXPECT_EQ(bucket_size, 8);
+}
}
diff --git a/be/src/exec/hash-table.cc b/be/src/exec/hash-table.cc
index 4605989..da2e2b1 100644
--- a/be/src/exec/hash-table.cc
+++ b/be/src/exec/hash-table.cc
@@ -475,14 +475,20 @@ HashTable::HashTable(bool quadratic_probing, Suballocator* allocator,
Status HashTable::Init(bool* got_memory) {
int64_t buckets_byte_size = num_buckets_ * sizeof(Bucket);
+ int64_t hash_byte_size = num_buckets_ * sizeof(uint32_t);
RETURN_IF_ERROR(allocator_->Allocate(buckets_byte_size, &bucket_allocation_));
- if (bucket_allocation_ == nullptr) {
+ RETURN_IF_ERROR(allocator_->Allocate(hash_byte_size, &hash_allocation_));
+ if (bucket_allocation_ == nullptr || hash_allocation_ == nullptr) {
num_buckets_ = 0;
*got_memory = false;
+ if (bucket_allocation_ != nullptr) allocator_->Free(move(bucket_allocation_));
+ if (hash_allocation_ != nullptr) allocator_->Free(move(hash_allocation_));
return Status::OK();
}
buckets_ = reinterpret_cast<Bucket*>(bucket_allocation_->data());
memset(buckets_, 0, buckets_byte_size);
+ hash_array_ = reinterpret_cast<uint32_t*>(hash_allocation_->data());
+ memset(hash_array_, 0, hash_byte_size);
*got_memory = true;
return Status::OK();
}
@@ -513,6 +519,19 @@ void HashTable::Close() {
for (auto& data_page : data_pages_) allocator_->Free(move(data_page));
data_pages_.clear();
if (bucket_allocation_ != nullptr) allocator_->Free(move(bucket_allocation_));
+ if (hash_allocation_ != nullptr) allocator_->Free(move(hash_allocation_));
+ ResetState();
+}
+
+void HashTable::ResetState() {
+ num_filled_buckets_ = 0;
+ num_buckets_with_duplicates_ = 0;
+ has_matches_ = false;
+ num_resizes_ = 0;
+ total_data_page_size_ = 0;
+ next_node_ = nullptr;
+ node_remaining_current_page_ = 0;
+ num_duplicate_nodes_ = 0;
}
void HashTable::StatsCountersAdd(HashTableStatsProfile* profile) {
@@ -553,15 +572,26 @@ Status HashTable::ResizeBuckets(
// of the old hash table.
// int64_t old_size = num_buckets_ * sizeof(Bucket);
int64_t new_size = num_buckets * sizeof(Bucket);
-
+ int64_t new_hash_size = num_buckets * sizeof(uint32_t);
unique_ptr<Suballocation> new_allocation;
+ unique_ptr<Suballocation> new_hash_allocation;
RETURN_IF_ERROR(allocator_->Allocate(new_size, &new_allocation));
- if (new_allocation == NULL) {
+ Status hash_allocation_status =
+ allocator_->Allocate(new_hash_size, &new_hash_allocation);
+ if (!hash_allocation_status.ok()) {
+ if (new_allocation != NULL) allocator_->Free(move(new_allocation));
+ return hash_allocation_status;
+ }
+ if (new_allocation == NULL || new_hash_allocation == NULL) {
+ if (new_allocation != NULL) allocator_->Free(move(new_allocation));
+ if (new_hash_allocation != NULL) allocator_->Free(move(new_hash_allocation));
*got_memory = false;
return Status::OK();
}
Bucket* new_buckets = reinterpret_cast<Bucket*>(new_allocation->data());
memset(new_buckets, 0, new_size);
+ uint32_t* new_hash_array = reinterpret_cast<uint32_t*>(new_hash_allocation->data());
+ memset(new_hash_array, 0, new_hash_size);
// Walk the old table and copy all the filled buckets to the new (resized) table.
// We do not have to do anything with the duplicate nodes. This operation is expected
@@ -569,20 +599,26 @@ Status HashTable::ResizeBuckets(
for (HashTable::Iterator iter = Begin(ht_ctx); !iter.AtEnd();
NextFilledBucket(&iter.bucket_idx_, &iter.node_)) {
Bucket* bucket_to_copy = &buckets_[iter.bucket_idx_];
+ uint32_t hash = hash_array_[iter.bucket_idx_];
bool found = false;
- int64_t bucket_idx = Probe<true, false>(
- new_buckets, num_buckets, ht_ctx, bucket_to_copy->hash, &found);
+ BucketData bd;
+ int64_t bucket_idx = Probe<true, false, HashTable::BucketType::MATCH_UNSET>(
+ new_buckets, new_hash_array, num_buckets, ht_ctx, hash, &found, &bd);
DCHECK(!found);
DCHECK_NE(bucket_idx, Iterator::BUCKET_NOT_FOUND) << " Probe failed even though "
" there are free buckets. " << num_buckets << " " << num_filled_buckets_;
Bucket* dst_bucket = &new_buckets[bucket_idx];
+ new_hash_array[bucket_idx] = hash;
*dst_bucket = *bucket_to_copy;
}
num_buckets_ = num_buckets;
allocator_->Free(move(bucket_allocation_));
+ allocator_->Free(move(hash_allocation_));
bucket_allocation_ = move(new_allocation);
- buckets_ = reinterpret_cast<Bucket*>(bucket_allocation_->data());
+ hash_allocation_ = move(new_hash_allocation);
+ buckets_ = new_buckets;
+ hash_array_ = new_hash_array;
*got_memory = true;
return Status::OK();
}
@@ -616,29 +652,30 @@ string HashTable::DebugString(bool skip_empty, bool show_match,
stringstream ss;
ss << endl;
for (int i = 0; i < num_buckets_; ++i) {
- if (skip_empty && !buckets_[i].filled) continue;
+ if (skip_empty && !buckets_[i].IsFilled()) continue;
ss << i << ": ";
if (show_match) {
- if (buckets_[i].matched) {
+ if (buckets_[i].IsMatched()) {
ss << " [M]";
} else {
ss << " [U]";
}
}
- if (buckets_[i].hasDuplicates) {
- DuplicateNode* node = buckets_[i].bucketData.duplicates;
+ if (buckets_[i].HasDuplicates()) {
+ DuplicateNode* node = buckets_[i].GetDuplicate();
bool first = true;
ss << " [D] ";
while (node != NULL) {
if (!first) ss << ",";
DebugStringTuple(ss, node->htdata, desc);
- node = node->next;
+ node = node->Next();
first = false;
}
} else {
ss << " [B] ";
- if (buckets_[i].filled) {
- DebugStringTuple(ss, buckets_[i].bucketData.htdata, desc);
+ if (buckets_[i].IsFilled()) {
+ HtData htdata = buckets_[i].GetBucketData().htdata;
+ DebugStringTuple(ss, htdata, desc);
} else {
ss << " - ";
}
diff --git a/be/src/exec/hash-table.h b/be/src/exec/hash-table.h
index 6f49408..0e18c06 100644
--- a/be/src/exec/hash-table.h
+++ b/be/src/exec/hash-table.h
@@ -35,6 +35,7 @@
#include "util/bitmap.h"
#include "util/hash-util.h"
#include "util/runtime-profile.h"
+#include "util/tagged-ptr.h"
namespace llvm {
class Function;
@@ -271,7 +272,8 @@ class HashTableCtx {
/// followed by a read pass. We refrain from providing an interface for random accesses
/// as there isn't a use case for it now and we want to avoid expensive multiplication
/// as the buffer size of each row is not necessarily power of two:
- /// - Reset(), ResetForRead(): reset the iterators before writing / reading cached values.
+ /// - Reset(), ResetForRead(): reset the iterators before writing / reading cached
+ /// values.
/// - NextRow(): moves the iterators to point to the next row of cached values.
/// - AtEnd(): returns true if all cached rows have been read. Valid in read mode only.
///
@@ -327,8 +329,8 @@ class HashTableCtx {
return cur_expr_values_hash_ == cur_expr_values_hash_end_;
}
- /// Returns true if the current row is null but nulls are not considered in the current
- /// phase (build or probe).
+ /// Returns true if the current row is null but nulls are not considered in the
+ /// current phase (build or probe).
bool ALWAYS_INLINE IsRowNull() const { return null_bitmap_.Get(CurIdx()); }
/// Record in a bitmap that the current row is null but nulls are not considered in
@@ -593,7 +595,7 @@ class HashTableCtx {
/// Total distance traveled for each probe. That is the sum of the diff between the end
/// position of a probe (find/insert) and its start position
- /// (hash & (num_buckets_ - 1)).
+ /// '(hash & (num_buckets_ - 1))'.
int64_t travel_length_ = 0;
/// The number of cases where we had to compare buckets with the same hash value, but
@@ -645,54 +647,148 @@ class HashTable {
Tuple* tuple;
};
+ struct DuplicateNode; // Forward Declaration
+ class TaggedDuplicateNode : public TaggedPtr<DuplicateNode, false> {
+ public:
+ ALWAYS_INLINE bool IsMatched() { return IsTagBitSet<0>(); }
+ ALWAYS_INLINE void SetMatched() { SetTagBit<0>(); }
+ ALWAYS_INLINE void SetNode(DuplicateNode* node) { SetPtr(node); }
+ // Set Node and UnsetMatched
+ ALWAYS_INLINE void SetNodeUnMatched(DuplicateNode* node) {
+ SetData(reinterpret_cast<uintptr_t>(node));
+ DCHECK(!IsMatched());
+ }
+ };
/// struct DuplicateNode is referenced by SIZE_OF_DUPLICATENODE of
/// planner/PlannerContext.java. If struct DuplicateNode is modified, please modify
/// SIZE_OF_DUPLICATENODE synchronously.
/// Linked list of entries used for duplicates.
struct DuplicateNode {
- /// Used for full outer and right {outer, anti, semi} joins. Indicates whether the
- /// row in the DuplicateNode has been matched.
- /// From an abstraction point of view, this is an awkward place to store this
- /// information.
- /// TODO: Fold this flag in the next pointer below.
- bool matched;
+ HtData htdata;
+ ALWAYS_INLINE DuplicateNode* Next() { return tdn.GetPtr(); }
+ ALWAYS_INLINE void SetNext(DuplicateNode* node) { tdn.SetNode(node); }
+ ALWAYS_INLINE bool IsMatched() { return tdn.IsMatched(); }
+ ALWAYS_INLINE void SetMatched() { tdn.SetMatched(); }
+ ALWAYS_INLINE void SetNextUnMatched(DuplicateNode* node) {
+ tdn.SetNodeUnMatched(node);
+ }
+ private:
/// Chain to next duplicate node, NULL when end of list.
- DuplicateNode* next;
+ /// 'bool matched' is folded into this next pointer. Tag bit 0 represents it.
+ TaggedDuplicateNode tdn;
+ };
+
+ union BucketData {
HtData htdata;
+ DuplicateNode* duplicates;
+ };
+
+ /// 'TaggedPtr' for 'BucketData'.
+ /// This doesn't own BucketData* so Allocation and Deallocation is not its
+ /// responsibility.
+ /// Following fields are also folded in the TagggedPtr below:
+ /// 1. bool matched: (Tag bit 0) Used for full outer and right {outer, anti, semi}
+ /// joins. Indicates whether the row in the bucket has been matched.
+ /// From an abstraction point of view, this is an awkward place to store this
+ /// information but it is efficient. This space is otherwise unused.
+ /// 2. bool hasDuplicates: (Tag bit 1) Used in case of duplicates. If true, then
+ /// the bucketData union should be used as 'duplicates'.
+ ///
+ /// 'TAGGED': Methods to fetch or set data might have template parameter TAGGED.
+ /// It can be set to 'false' only when tag fields above are not set. This avoids
+ /// extra bit operations.
+ class TaggedBucketData : public TaggedPtr<uint8, false> {
+ public:
+ TaggedBucketData() = default;
+ ALWAYS_INLINE bool IsFilled() { return GetData() != 0; }
+ ALWAYS_INLINE bool IsMatched() { return IsTagBitSet<0>(); }
+ ALWAYS_INLINE bool HasDuplicates() { return IsTagBitSet<1>(); }
+ ALWAYS_INLINE void SetMatched() { SetTagBit<0>(); }
+ ALWAYS_INLINE void SetHasDuplicates() { SetTagBit<1>(); }
+ /// Set 'data' as BucketData. 'TAGGED' is described in class description.
+ template <class T, const bool TAGGED>
+ ALWAYS_INLINE void SetBucketData(T* data) {
+ (TAGGED) ? SetPtr(reinterpret_cast<uint8*>(data)) :
+ SetData(reinterpret_cast<uintptr_t>(data));
+ }
+ /// Get tuple pointer stored. 'TAGGED' is described in class description.
+ template <bool TAGGED>
+ ALWAYS_INLINE Tuple* GetTuple() {
+ return (TAGGED) ? reinterpret_cast<Tuple*>(GetPtr()) :
+ reinterpret_cast<Tuple*>(GetData());
+ }
+ ALWAYS_INLINE DuplicateNode* GetDuplicate() {
+ return reinterpret_cast<DuplicateNode*>(GetPtr());
+ }
+ ALWAYS_INLINE void PrepareBucketForInsert() { SetData(0); }
+ TaggedBucketData& operator=(const TaggedBucketData& bd) = default;
};
/// struct Bucket is referenced by SIZE_OF_BUCKET of planner/PlannerContext.java.
/// If struct Bucket is modified, please modify SIZE_OF_BUCKET synchronously.
+ /// TaggedPtr is used to store BucketData. 2 booleans are folded into
+ /// TaggedPtr. Check comments for TaggedBucketData for details on booleans
+ /// stored.
struct Bucket {
+ /// Return the BucketData.
+ /// 'TAGGED' is described in the comments for 'TaggedBucketData'.
+ template <bool TAGGED = true>
+ ALWAYS_INLINE BucketData GetBucketData() {
+ BucketData bucket_data;
+ bucket_data.htdata.tuple = bd.GetTuple<TAGGED>();
+ return bucket_data;
+ }
+ /// Get Tuple pointer stored in bucket.
+ /// 'TAGGED' is described in the comments for 'TaggedBucketData'.
+ template <bool TAGGED = true>
+ ALWAYS_INLINE Tuple* GetTuple() {
+ return bd.GetTuple<TAGGED>();
+ }
+ /// Get Duplicate Node
+ ALWAYS_INLINE DuplicateNode* GetDuplicate() { return bd.GetDuplicate(); }
/// Whether this bucket contains a vaild entry, or it is empty.
- bool filled;
-
- /// Used for full outer and right {outer, anti, semi} joins. Indicates whether the
- /// row in the bucket has been matched.
- /// From an abstraction point of view, this is an awkward place to store this
- /// information but it is efficient. This space is otherwise unused.
- bool matched;
-
- /// Used in case of duplicates. If true, then the bucketData union should be used as
- /// 'duplicates'.
- bool hasDuplicates;
-
- /// Cache of the hash for data.
- /// TODO: Do we even have to cache the hash value?
- uint32_t hash;
-
- /// Either the data for this bucket or the linked list of duplicates.
- union {
- HtData htdata;
- DuplicateNode* duplicates;
- } bucketData;
+ ALWAYS_INLINE bool IsFilled() { return bd.IsFilled(); }
+ /// Indicates whether the row in the bucket has been matched.
+ /// For more details read the comment for TaggedBucketData.
+ ALWAYS_INLINE bool IsMatched() { return bd.IsMatched(); }
+ /// Indicates if bucket has duplicates instead of data for bucket.
+ ALWAYS_INLINE bool HasDuplicates() { return bd.HasDuplicates(); }
+
+ /// Set/Unset methods corresponding to above.
+ ALWAYS_INLINE void SetMatched() { bd.SetMatched(); }
+ ALWAYS_INLINE void SetHasDuplicates() { bd.SetHasDuplicates(); }
+ /// Set DuplicateNode pointer as data.
+ /// 'TAGGED' is described in the comments for 'TaggedBucketData'.
+ template <bool TAGGED = true>
+ ALWAYS_INLINE void SetDuplicate(DuplicateNode* node) {
+ bd.SetBucketData<DuplicateNode, TAGGED>(node);
+ }
+ /// Set Tuple pointer as data.
+ /// 'TAGGED' is described in the comments for 'TaggedBucketData'.
+ template <bool TAGGED = true>
+ ALWAYS_INLINE void SetTuple(Tuple* tuple) {
+ bd.SetBucketData<Tuple, TAGGED>(tuple);
+ }
+ /// Set FlatRowPtr as data.
+ /// 'TAGGED' is described in the comments for 'TaggedBucketData'.
+ template <bool TAGGED = true>
+ ALWAYS_INLINE void SetFlatRow(BufferedTupleStream::FlatRowPtr flat_row) {
+ bd.SetBucketData<uint8_t, TAGGED>(flat_row);
+ }
+ ALWAYS_INLINE void PrepareBucketForInsert() { bd.PrepareBucketForInsert(); }
+
+ private:
+ // This should not be exposed outside as implementation details
+ // can change.
+ TaggedBucketData bd;
};
- static_assert(BitUtil::IsPowerOf2(sizeof(Bucket)),
- "We assume that Hash-table bucket directories are a power-of-two sizes because "
- "allocating only bucket directories with power-of-two byte sizes avoids internal "
- "fragmentation in the simple buddy allocator.");
+ static_assert(BitUtil::IsPowerOf2(sizeof(Bucket) && sizeof(Bucket) == 8),
+ "We assume that Hash-table bucket directories are a power-of-two (8 bytes "
+ "currently) sizes because allocating only bucket directories with power-of-two "
+ "byte sizes avoids internal fragmentation in the simple buddy allocator. Assert "
+ "checks for fixed size to avoid accidental changes.");
public:
class Iterator;
@@ -766,14 +862,25 @@ class HashTable {
/// Thread-safe for read-only hash tables.
Iterator IR_ALWAYS_INLINE FindProbeRow(HashTableCtx* __restrict__ ht_ctx);
+ /// Enum for the type of Bucket
+ enum BucketType : bool {
+ MATCH_SET = true, // matched flag is not set for the bucket
+ MATCH_UNSET = false // matched flag is not set for the bucket
+ };
+
/// If a match is found in the table, return an iterator as in FindProbeRow(). If a
/// match was not present, return an iterator pointing to the empty bucket where the key
/// should be inserted. Returns End() if the table is full. The caller can set the data
/// in the bucket using a Set*() method on the iterator.
+ /// 'MATCH' is set true if Buckets of HashTable can have matched flag set.
/// Thread-safe for read-only hash tables.
+ template <BucketType TYPE = MATCH_SET>
Iterator IR_ALWAYS_INLINE FindBuildRowBucket(
HashTableCtx* __restrict__ ht_ctx, bool* found);
+ /// Find slot for 'hash' from 0 to 'num_buckets'.
+ int64_t getBucketId(uint32_t hash, int64_t num_buckets);
+
/// Returns number of elements inserted in the hash table
/// Thread-safe for read-only hash tables.
int64_t size() const {
@@ -807,7 +914,7 @@ class HashTable {
}
/// Return the size of a hash table bucket in bytes.
- static int64_t BucketSize() { return sizeof(Bucket); }
+ static const int64_t BUCKET_SIZE = sizeof(Bucket);
/// Returns the memory occupied by the hash table, takes into account the number of
/// duplicates.
@@ -899,8 +1006,10 @@ class HashTable {
/// Return the current row or tuple. Callers must check the iterator is not AtEnd()
/// before calling them. The returned row is owned by the iterator and valid until
/// the next call to GetRow(). It is safe to advance the iterator.
+ /// 'MATCH' is true when current node has 'IsMatched()' flag true.
/// Thread-safe for read-only hash tables.
TupleRow* IR_ALWAYS_INLINE GetRow() const;
+ template <BucketType TYPE = MATCH_SET>
Tuple* IR_ALWAYS_INLINE GetTuple() const;
/// Set the current tuple for an empty bucket. Designed to be used with the iterator
@@ -988,19 +1097,24 @@ class HashTable {
/// 'INCLUSIVE_EQUALITY' is true if NULLs and NaNs should always be
/// considered equal when comparing two rows.
///
+ /// 'MATCH' is false if none of 'buckets' has matched (IsMatched) flag set. For
+ /// instance in the case of Grouping Aggregate it would be false.
+ ///
/// 'hash' is the hash computed by EvalAndHashBuild() or EvalAndHashProbe().
/// 'found' indicates that a bucket that contains an equal row is found.
///
/// There are wrappers of this function that perform the Find and Insert logic.
- template <bool INCLUSIVE_EQUALITY, bool COMPARE_ROW>
- int64_t IR_ALWAYS_INLINE Probe(Bucket* buckets, int64_t num_buckets,
- HashTableCtx* __restrict__ ht_ctx, uint32_t hash, bool* found);
-
- /// Performs the insert logic. Returns the HtData* of the bucket or duplicate node
- /// where the data should be inserted. Returns NULL if the insert was not successful
- /// and either sets 'status' to OK if it failed because not enough reservation was
- /// available or the error if an error was encountered.
- HtData* IR_ALWAYS_INLINE InsertInternal(
+ template <bool INCLUSIVE_EQUALITY, bool COMPARE_ROW, BucketType TYPE = MATCH_SET>
+ int64_t IR_ALWAYS_INLINE Probe(Bucket* buckets, uint32_t* hash_array,
+ int64_t num_buckets, HashTableCtx* __restrict__ ht_ctx, uint32_t hash, bool* found,
+ BucketData* bd);
+
+ /// Performs the insert logic. Returns the Bucket* of the bucket where the data
+ /// should be inserted either in the bucket itself or in it's DuplicateNode.
+ /// Returns NULL if the insert was not successful and either sets 'status' to OK
+ /// if it failed because not enough reservation was available or the error if an
+ /// error was encountered.
+ Bucket* IR_ALWAYS_INLINE InsertInternal(
HashTableCtx* __restrict__ ht_ctx, Status* status);
/// Updates 'bucket_idx' to the index of the next non-empty bucket. If the bucket has
@@ -1027,7 +1141,8 @@ class HashTable {
/// Returns NULL and sets 'status' to OK if the node array could not grow, i.e. there
/// was not enough memory to allocate a new DuplicateNode. Returns NULL and sets
/// 'status' to an error if another error was encountered.
- DuplicateNode* IR_ALWAYS_INLINE InsertDuplicateNode(int64_t bucket_idx, Status* status);
+ DuplicateNode* IR_ALWAYS_INLINE InsertDuplicateNode(
+ int64_t bucket_idx, Status* status, BucketData* bucket_data);
/// Resets the contents of the empty bucket with index 'bucket_idx', in preparation for
/// an insert. Sets all the fields of the bucket other than 'data'.
@@ -1038,13 +1153,21 @@ class HashTable {
/// Returns the TupleRow of the pointed 'bucket'. In case of duplicates, it
/// returns the content of the first chained duplicate node of the bucket.
- TupleRow* GetRow(Bucket* bucket, TupleRow* row) const;
+ /// It also fills 'bd' with the BucketData of 'bucket'.
+ /// 'MATCH' is set true if 'bucket' can have matched flag set i.e.,
+ /// 'IsMatched()' returns true.
+ /// They can either have duplicates or matched buckets.
+ template <BucketType TYPE = MATCH_SET>
+ TupleRow* GetRow(Bucket* bucket, TupleRow* row, BucketData* bd) const;
/// Grow the node array. Returns true and sets 'status' to OK on success. Returns false
/// and set 'status' to OK if we can't get sufficient reservation to allocate the next
/// data page. Returns false and sets 'status' if another error is encountered.
bool GrowNodeArray(Status* status);
+ /// Reset HashTable's internal state to Default State
+ void ResetState();
+
/// Functions to be replaced by codegen to specialize the hash table.
bool IR_NO_INLINE stores_tuples() const { return stores_tuples_; }
bool IR_NO_INLINE stores_duplicates() const { return stores_duplicates_; }
@@ -1104,6 +1227,14 @@ class HashTable {
/// Pointer to the 'buckets_' array from 'bucket_allocation_'.
Bucket* buckets_ = nullptr;
+ /// Allocation containing the cached hash value for every bucket.
+ std::unique_ptr<Suballocation> hash_allocation_;
+
+ /// Cache of the hash for data. It is an array of hash values where ith value
+ /// corresponds to hash value of ith bucket in 'buckets_' array.
+ /// This is not part of struct 'Bucket' to make sure 'sizeof(Bucket)' is power of 2.
+ uint32_t* hash_array_;
+
/// Total number of buckets (filled and empty).
int64_t num_buckets_;
@@ -1125,4 +1256,4 @@ class HashTable {
int64_t num_resizes_ = 0;
};
-}
+} // namespace impala
diff --git a/be/src/exec/hash-table.inline.h b/be/src/exec/hash-table.inline.h
index 74f2470..54f8b81 100644
--- a/be/src/exec/hash-table.inline.h
+++ b/be/src/exec/hash-table.inline.h
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-
#ifndef IMPALA_EXEC_HASH_TABLE_INLINE_H
#define IMPALA_EXEC_HASH_TABLE_INLINE_H
@@ -48,9 +47,10 @@ inline void HashTableCtx::ExprValuesCache::NextRow() {
DCHECK_LE(cur_expr_values_hash_ - expr_values_hash_array_.get(), capacity_);
}
-template <bool INCLUSIVE_EQUALITY, bool COMPARE_ROW>
-inline int64_t HashTable::Probe(Bucket* buckets, int64_t num_buckets,
- HashTableCtx* __restrict__ ht_ctx, uint32_t hash, bool* found) {
+template <bool INCLUSIVE_EQUALITY, bool COMPARE_ROW, HashTable::BucketType TYPE>
+inline int64_t HashTable::Probe(Bucket* buckets, uint32_t* hash_array,
+ int64_t num_buckets, HashTableCtx* __restrict__ ht_ctx, uint32_t hash, bool* found,
+ BucketData* bd) {
DCHECK(ht_ctx != nullptr);
DCHECK(buckets != nullptr);
DCHECK_GT(num_buckets, 0);
@@ -64,10 +64,11 @@ inline int64_t HashTable::Probe(Bucket* buckets, int64_t num_buckets,
int64_t step = 0;
do {
Bucket* bucket = &buckets[bucket_idx];
- if (LIKELY(!bucket->filled)) return bucket_idx;
- if (hash == bucket->hash) {
+ if (LIKELY(!bucket->IsFilled())) return bucket_idx;
+ if (hash == hash_array[bucket_idx]) {
if (COMPARE_ROW
- && ht_ctx->Equals<INCLUSIVE_EQUALITY>(GetRow(bucket, ht_ctx->scratch_row_))) {
+ && ht_ctx->Equals<INCLUSIVE_EQUALITY>(
+ GetRow<TYPE>(bucket, ht_ctx->scratch_row_, bd))) {
*found = true;
return bucket_idx;
}
@@ -77,55 +78,68 @@ inline int64_t HashTable::Probe(Bucket* buckets, int64_t num_buckets,
}
// Move to the next bucket.
++step;
- ++ht_ctx->travel_length_;
if (quadratic_probing()) {
- // The i-th probe location is idx = (hash + (step * (step + 1)) / 2) mod num_buckets.
- // This gives num_buckets unique idxs (between 0 and N-1) when num_buckets is a power
- // of 2.
+ // The i-th probe location is idx = (hash + (step * (step + 1)) / 2) mod
+ // num_buckets. This gives num_buckets unique idxs (between 0 and N-1) when
+ // num_buckets is a power of 2.
bucket_idx = (bucket_idx + step) & (num_buckets - 1);
} else {
+ // Linear probing
bucket_idx = (bucket_idx + 1) & (num_buckets - 1);
}
} while (LIKELY(step < num_buckets));
- DCHECK_EQ(num_filled_buckets_, num_buckets) << "Probing of a non-full table "
+ ht_ctx->travel_length_ += step;
+
+ DCHECK_EQ(num_filled_buckets_, num_buckets)
+ << "Probing of a non-full table "
<< "failed: " << quadratic_probing() << " " << hash;
return Iterator::BUCKET_NOT_FOUND;
}
-inline HashTable::HtData* HashTable::InsertInternal(
+inline HashTable::Bucket* HashTable::InsertInternal(
HashTableCtx* __restrict__ ht_ctx, Status* status) {
bool found = false;
uint32_t hash = ht_ctx->expr_values_cache()->CurExprValuesHash();
- int64_t bucket_idx = Probe<true, true>(buckets_, num_buckets_, ht_ctx, hash, &found);
+ BucketData bd;
+ int64_t bucket_idx =
+ Probe<true, true>(buckets_, hash_array_, num_buckets_, ht_ctx, hash, &found, &bd);
DCHECK_NE(bucket_idx, Iterator::BUCKET_NOT_FOUND);
if (found) {
// We need to insert a duplicate node, note that this may fail to allocate memory.
- DuplicateNode* new_node = InsertDuplicateNode(bucket_idx, status);
+ DuplicateNode* new_node = InsertDuplicateNode(bucket_idx, status, &bd);
if (UNLIKELY(new_node == NULL)) return NULL;
- return &new_node->htdata;
} else {
PrepareBucketForInsert(bucket_idx, hash);
- return &buckets_[bucket_idx].bucketData.htdata;
}
+ return &buckets_[bucket_idx];
}
inline bool HashTable::Insert(HashTableCtx* __restrict__ ht_ctx,
BufferedTupleStream::FlatRowPtr flat_row, TupleRow* row, Status* status) {
- HtData* htdata = InsertInternal(ht_ctx, status);
+ Bucket* bucket = InsertInternal(ht_ctx, status);
+ if (UNLIKELY(bucket == NULL)) return false;
// If successful insert, update the contents of the newly inserted entry with 'idx'.
- if (LIKELY(htdata != NULL)) {
+ if (bucket->HasDuplicates()) {
+ DuplicateNode* node = bucket->GetDuplicate();
+ if (UNLIKELY(node == NULL)) return false;
if (stores_tuples()) {
- htdata->tuple = row->GetTuple(0);
+ node->htdata.tuple = row->GetTuple(0);
} else {
- htdata->flat_row = flat_row;
+ node->htdata.flat_row = flat_row;
+ }
+ } else {
+ if (stores_tuples()) {
+ Tuple* tuple = row->GetTuple(0);
+ bucket->SetTuple(tuple);
+ } else {
+ bucket->SetFlatRow(flat_row);
}
- return true;
}
- return false;
+ return true;
}
-template<const bool READ>
+template <const bool READ>
inline void HashTable::PrefetchBucket(uint32_t hash) {
int64_t bucket_idx = hash & (num_buckets_ - 1);
// Two optional arguments:
@@ -134,27 +148,33 @@ inline void HashTable::PrefetchBucket(uint32_t hash) {
// On x86, they map to instructions prefetchnta and prefetch{2-0} respectively.
// TODO: Reconsider the locality level with smaller prefetch batch size.
__builtin_prefetch(&buckets_[bucket_idx], READ ? 0 : 1, 1);
+ __builtin_prefetch(&hash_array_[bucket_idx], READ ? 0 : 1, 1);
}
inline HashTable::Iterator HashTable::FindProbeRow(HashTableCtx* __restrict__ ht_ctx) {
bool found = false;
uint32_t hash = ht_ctx->expr_values_cache()->CurExprValuesHash();
- int64_t bucket_idx = Probe<false, true>(buckets_, num_buckets_, ht_ctx, hash, &found);
+ BucketData bd;
+ int64_t bucket_idx =
+ Probe<false, true>(buckets_, hash_array_, num_buckets_, ht_ctx, hash, &found, &bd);
if (found) {
return Iterator(this, ht_ctx->scratch_row(), bucket_idx,
- stores_duplicates() ? buckets_[bucket_idx].bucketData.duplicates : NULL);
+ stores_duplicates() ? bd.duplicates : NULL);
}
return End();
}
// TODO: support lazy evaluation like HashTable::Insert().
+template <HashTable::BucketType TYPE>
inline HashTable::Iterator HashTable::FindBuildRowBucket(
HashTableCtx* __restrict__ ht_ctx, bool* found) {
uint32_t hash = ht_ctx->expr_values_cache()->CurExprValuesHash();
- int64_t bucket_idx = Probe<true, true>(buckets_, num_buckets_, ht_ctx, hash, found);
+ BucketData bd;
+ int64_t bucket_idx = Probe<true, true, TYPE>(
+ buckets_, hash_array_, num_buckets_, ht_ctx, hash, found, &bd);
DuplicateNode* duplicates = NULL;
if (stores_duplicates() && LIKELY(bucket_idx != Iterator::BUCKET_NOT_FOUND)) {
- duplicates = buckets_[bucket_idx].bucketData.duplicates;
+ duplicates = bd.duplicates;
}
return Iterator(this, ht_ctx->scratch_row(), bucket_idx, duplicates);
}
@@ -174,8 +194,8 @@ inline HashTable::Iterator HashTable::FirstUnmatched(HashTableCtx* ctx) {
// Check whether the bucket, or its first duplicate node, is matched. If it is not
// matched, then return. Otherwise, move to the first unmatched entry (node or bucket).
Bucket* bucket = &buckets_[bucket_idx];
- bool has_duplicates = stores_duplicates() && bucket->hasDuplicates;
- if ((!has_duplicates && bucket->matched) || (has_duplicates && node->matched)) {
+ bool has_duplicates = stores_duplicates() && bucket->HasDuplicates();
+ if ((!has_duplicates && bucket->IsMatched()) || (has_duplicates && node->IsMatched())) {
it.NextUnmatched();
}
return it;
@@ -184,8 +204,8 @@ inline HashTable::Iterator HashTable::FirstUnmatched(HashTableCtx* ctx) {
inline void HashTable::NextFilledBucket(int64_t* bucket_idx, DuplicateNode** node) {
++*bucket_idx;
for (; *bucket_idx < num_buckets_; ++*bucket_idx) {
- if (buckets_[*bucket_idx].filled) {
- *node = stores_duplicates() ? buckets_[*bucket_idx].bucketData.duplicates : NULL;
+ if (buckets_[*bucket_idx].IsFilled()) {
+ *node = stores_duplicates() ? buckets_[*bucket_idx].GetDuplicate() : NULL;
return;
}
}
@@ -198,54 +218,53 @@ inline void HashTable::PrepareBucketForInsert(int64_t bucket_idx, uint32_t hash)
DCHECK_GE(bucket_idx, 0);
DCHECK_LT(bucket_idx, num_buckets_);
Bucket* bucket = &buckets_[bucket_idx];
- DCHECK(!bucket->filled);
+ DCHECK(!bucket->IsFilled());
++num_filled_buckets_;
- bucket->filled = true;
- bucket->matched = false;
- bucket->hasDuplicates = false;
- bucket->hash = hash;
+ bucket->PrepareBucketForInsert();
+ hash_array_[bucket_idx] = hash;
}
inline HashTable::DuplicateNode* HashTable::AppendNextNode(Bucket* bucket) {
DCHECK_GT(node_remaining_current_page_, 0);
- bucket->bucketData.duplicates = next_node_;
+ bucket->SetDuplicate(next_node_);
++num_duplicate_nodes_;
--node_remaining_current_page_;
return next_node_++;
}
inline HashTable::DuplicateNode* HashTable::InsertDuplicateNode(
- int64_t bucket_idx, Status* status) {
+ int64_t bucket_idx, Status* status, BucketData* bucket_data) {
DCHECK_GE(bucket_idx, 0);
DCHECK_LT(bucket_idx, num_buckets_);
Bucket* bucket = &buckets_[bucket_idx];
- DCHECK(bucket->filled);
+ DCHECK(bucket->IsFilled());
DCHECK(stores_duplicates());
+ bool has_duplicates = bucket->HasDuplicates();
// Allocate one duplicate node for the new data and one for the preexisting data,
// if needed.
- while (node_remaining_current_page_ < 1 + !bucket->hasDuplicates) {
+ while (node_remaining_current_page_ < 1 + !has_duplicates) {
if (UNLIKELY(!GrowNodeArray(status))) return NULL;
}
- if (!bucket->hasDuplicates) {
+ if (!has_duplicates) {
// This is the first duplicate in this bucket. It means that we need to convert
// the current entry in the bucket to a node and link it from the bucket.
- next_node_->htdata.flat_row = bucket->bucketData.htdata.flat_row;
- DCHECK(!bucket->matched);
- next_node_->matched = false;
- next_node_->next = NULL;
+ next_node_->htdata.flat_row = bucket_data->htdata.flat_row;
+ DCHECK(!bucket->IsMatched());
+ next_node_->SetNextUnMatched(nullptr);
AppendNextNode(bucket);
- bucket->hasDuplicates = true;
+ bucket->SetHasDuplicates();
++num_buckets_with_duplicates_;
}
- // Link a new node.
- next_node_->next = bucket->bucketData.duplicates;
- next_node_->matched = false;
+ // Link a new node and UnsetMatched
+ next_node_->SetNextUnMatched(bucket->GetDuplicate());
return AppendNextNode(bucket);
}
inline TupleRow* IR_ALWAYS_INLINE HashTable::GetRow(HtData& htdata, TupleRow* row) const {
if (stores_tuples()) {
- return reinterpret_cast<TupleRow*>(&htdata.tuple);
+ row->SetTuple(0, htdata.tuple);
+ // return reinterpret_cast<TupleRow*>(&htdata.tuple);
+ return row;
} else {
// TODO: GetTupleRow() has interpreted code that iterates over the row's descriptor.
tuple_stream_->GetTupleRow(htdata.flat_row, row);
@@ -253,14 +272,18 @@ inline TupleRow* IR_ALWAYS_INLINE HashTable::GetRow(HtData& htdata, TupleRow* ro
}
}
-inline TupleRow* IR_ALWAYS_INLINE HashTable::GetRow(Bucket* bucket, TupleRow* row) const {
+template <HashTable::BucketType TYPE>
+inline TupleRow* IR_ALWAYS_INLINE HashTable::GetRow(
+ Bucket* bucket, TupleRow* row, BucketData* bucket_data) const {
DCHECK(bucket != NULL);
- if (UNLIKELY(stores_duplicates() && bucket->hasDuplicates)) {
- DuplicateNode* duplicate = bucket->bucketData.duplicates;
+ if (UNLIKELY(stores_duplicates() && bucket->HasDuplicates())) {
+ *bucket_data = bucket->GetBucketData();
+ DuplicateNode* duplicate = bucket_data->duplicates;
DCHECK(duplicate != NULL);
return GetRow(duplicate->htdata, row);
} else {
- return GetRow(bucket->bucketData.htdata, row);
+ *bucket_data = bucket->GetBucketData<TYPE>();
+ return GetRow(bucket_data->htdata, row);
}
}
@@ -269,24 +292,26 @@ inline TupleRow* IR_ALWAYS_INLINE HashTable::Iterator::GetRow() const {
DCHECK(table_ != NULL);
DCHECK(scratch_row_ != NULL);
Bucket* bucket = &table_->buckets_[bucket_idx_];
- if (UNLIKELY(table_->stores_duplicates() && bucket->hasDuplicates)) {
+ if (UNLIKELY(table_->stores_duplicates() && bucket->HasDuplicates())) {
DCHECK(node_ != NULL);
return table_->GetRow(node_->htdata, scratch_row_);
} else {
- return table_->GetRow(bucket->bucketData.htdata, scratch_row_);
+ HtData htdata = bucket->GetBucketData().htdata;
+ return table_->GetRow(htdata, scratch_row_);
}
}
+template <HashTable::BucketType TYPE>
inline Tuple* IR_ALWAYS_INLINE HashTable::Iterator::GetTuple() const {
DCHECK(!AtEnd());
DCHECK(table_->stores_tuples());
Bucket* bucket = &table_->buckets_[bucket_idx_];
- // TODO: To avoid the hasDuplicates check, store the HtData* in the Iterator.
- if (UNLIKELY(table_->stores_duplicates() && bucket->hasDuplicates)) {
+ // TODO: To avoid the has_duplicates check, store the HtData* in the Iterator.
+ if (UNLIKELY(table_->stores_duplicates() && bucket->HasDuplicates())) {
DCHECK(node_ != NULL);
return node_->htdata.tuple;
} else {
- return bucket->bucketData.htdata.tuple;
+ return bucket->GetTuple<TYPE>();
}
}
@@ -294,16 +319,16 @@ inline void HashTable::Iterator::SetTuple(Tuple* tuple, uint32_t hash) {
DCHECK(!AtEnd());
DCHECK(table_->stores_tuples());
table_->PrepareBucketForInsert(bucket_idx_, hash);
- table_->buckets_[bucket_idx_].bucketData.htdata.tuple = tuple;
+ table_->buckets_[bucket_idx_].SetTuple<false>(tuple);
}
inline void HashTable::Iterator::SetMatched() {
DCHECK(!AtEnd());
Bucket* bucket = &table_->buckets_[bucket_idx_];
- if (table_->stores_duplicates() && bucket->hasDuplicates) {
- node_->matched = true;
+ if (table_->stores_duplicates() && bucket->HasDuplicates()) {
+ node_->SetMatched();
} else {
- bucket->matched = true;
+ bucket->SetMatched();
}
// Used for disabling spilling of hash tables in right and full-outer joins with
// matches. See IMPALA-1488.
@@ -313,10 +338,10 @@ inline void HashTable::Iterator::SetMatched() {
inline bool HashTable::Iterator::IsMatched() const {
DCHECK(!AtEnd());
Bucket* bucket = &table_->buckets_[bucket_idx_];
- if (table_->stores_duplicates() && bucket->hasDuplicates) {
- return node_->matched;
+ if (table_->stores_duplicates() && bucket->HasDuplicates()) {
+ return node_->IsMatched();
}
- return bucket->matched;
+ return bucket->IsMatched();
}
inline void HashTable::Iterator::SetAtEnd() {
@@ -324,7 +349,7 @@ inline void HashTable::Iterator::SetAtEnd() {
node_ = NULL;
}
-template<const bool READ>
+template <const bool READ>
inline void HashTable::Iterator::PrefetchBucket() {
if (LIKELY(!AtEnd())) {
// HashTable::PrefetchBucket() takes a hash value to index into the hash bucket
@@ -336,9 +361,9 @@ inline void HashTable::Iterator::PrefetchBucket() {
inline void HashTable::Iterator::Next() {
DCHECK(!AtEnd());
- if (table_->stores_duplicates() && table_->buckets_[bucket_idx_].hasDuplicates &&
- node_->next != NULL) {
- node_ = node_->next;
+ if (table_->stores_duplicates() && table_->buckets_[bucket_idx_].HasDuplicates()
+ && node_->Next() != NULL) {
+ node_ = node_->Next();
} else {
table_->NextFilledBucket(&bucket_idx_, &node_);
}
@@ -346,9 +371,9 @@ inline void HashTable::Iterator::Next() {
inline void HashTable::Iterator::NextDuplicate() {
DCHECK(!AtEnd());
- if (table_->stores_duplicates() && table_->buckets_[bucket_idx_].hasDuplicates &&
- node_->next != NULL) {
- node_ = node_->next;
+ if (table_->stores_duplicates() && table_->buckets_[bucket_idx_].HasDuplicates()
+ && node_->Next() != NULL) {
+ node_ = node_->Next();
} else {
bucket_idx_ = BUCKET_NOT_FOUND;
node_ = NULL;
@@ -359,10 +384,12 @@ inline void HashTable::Iterator::NextUnmatched() {
DCHECK(!AtEnd());
Bucket* bucket = &table_->buckets_[bucket_idx_];
// Check if there is any remaining unmatched duplicate node in the current bucket.
- if (table_->stores_duplicates() && bucket->hasDuplicates) {
- while (node_->next != NULL) {
- node_ = node_->next;
- if (!node_->matched) return;
+ if (table_->stores_duplicates() && bucket->HasDuplicates()) {
+ auto next_node = node_->Next();
+ while (next_node != NULL) {
+ node_ = next_node;
+ if (!node_->IsMatched()) return;
+ next_node = next_node->Next();
}
}
// Move to the next filled bucket and return if this bucket is not matched or
@@ -370,13 +397,15 @@ inline void HashTable::Iterator::NextUnmatched() {
table_->NextFilledBucket(&bucket_idx_, &node_);
while (bucket_idx_ != Iterator::BUCKET_NOT_FOUND) {
bucket = &table_->buckets_[bucket_idx_];
- if (!table_->stores_duplicates() || !bucket->hasDuplicates) {
- if (!bucket->matched) return;
+ if (!table_->stores_duplicates() || !bucket->HasDuplicates()) {
+ if (!bucket->IsMatched()) return;
} else {
- while (node_->matched && node_->next != NULL) {
- node_ = node_->next;
+ auto next_node = node_->Next();
+ while (node_->IsMatched() && next_node != NULL) {
+ node_ = next_node;
+ next_node = next_node->Next();
}
- if (!node_->matched) return;
+ if (!node_->IsMatched()) return;
}
table_->NextFilledBucket(&bucket_idx_, &node_);
}
@@ -389,7 +418,8 @@ inline void HashTableCtx::set_level(int level) {
}
inline int64_t HashTable::CurrentMemSize() const {
- return num_buckets_ * sizeof(Bucket) + num_duplicate_nodes_ * sizeof(DuplicateNode);
+ return num_buckets_ * (sizeof(Bucket) + sizeof(uint32_t))
+ + num_duplicate_nodes_ * sizeof(DuplicateNode);
}
inline int64_t HashTable::NumInsertsBeforeResize() const {
@@ -397,6 +427,6 @@ inline int64_t HashTable::NumInsertsBeforeResize() const {
0, static_cast<int64_t>(num_buckets_ * MAX_FILL_FACTOR) - num_filled_buckets_);
}
-}
+} // namespace impala
#endif
diff --git a/be/src/util/CMakeLists.txt b/be/src/util/CMakeLists.txt
index 2eedc91..e6d5fc7 100644
--- a/be/src/util/CMakeLists.txt
+++ b/be/src/util/CMakeLists.txt
@@ -180,6 +180,7 @@ add_library(UtilTests STATIC
symbols-util-test.cc
sys-info-test.cc
system-state-info-test.cc
+ tagged-ptr-test.cc
thread-pool-test.cc
time-test.cc
tuple-row-compare-test.cc
@@ -259,3 +260,4 @@ ADD_UNIFIED_BE_LSAN_TEST(uid-util-test "UidUtil.*")
ADD_BE_LSAN_TEST(webserver-test)
TARGET_LINK_LIBRARIES(webserver-test mini_kdc)
ADD_UNIFIED_BE_LSAN_TEST(zip-util-test "ZipUtilTest.*")
+ADD_UNIFIED_BE_LSAN_TEST(tagged-ptr-test "TaggedPtrTest.*")
\ No newline at end of file
diff --git a/be/src/util/benchmark.cc b/be/src/util/benchmark.cc
index 6ffbf00..d08fcf7 100644
--- a/be/src/util/benchmark.cc
+++ b/be/src/util/benchmark.cc
@@ -136,9 +136,12 @@ int Benchmark::AddBenchmark(const string& name, BenchmarkFunction fn, void* args
return benchmarks_.size() - 1;
}
-string Benchmark::Measure(int max_time, int initial_batch_size) {
+string Benchmark::Measure(
+ int max_time, int initial_batch_size, BenchmarkSetupFunction fn) {
if (benchmarks_.empty()) return "";
+ if (fn != NULL) fn(benchmarks_[0].args);
+
// Run a warmup to iterate through the data
benchmarks_[0].fn(10, benchmarks_[0].args);
@@ -168,6 +171,7 @@ string Benchmark::Measure(int max_time, int initial_batch_size) {
try {
for (int j = 0; j < NUM_REPS; ++j) {
for (int i = 0; i < benchmarks_.size(); ++i) {
+ if (fn != NULL) fn(benchmarks_[i].args);
benchmarks_[i].rates.push_back(
Measure(benchmarks_[i].fn, benchmarks_[i].args, max_time, initial_batch_size,
micro_heuristics_));
diff --git a/be/src/util/benchmark.h b/be/src/util/benchmark.h
index 7a8a7f2..b1a7e17 100644
--- a/be/src/util/benchmark.h
+++ b/be/src/util/benchmark.h
@@ -44,6 +44,9 @@ class Benchmark {
/// call overhead). The second argument is opaque and is whatever data the test
/// function needs to execute.
typedef void (*BenchmarkFunction)(int iters, void*);
+ /// SetupFunction that might be required to be executed before every iteration of
+ /// 'BenchmarkFunction'. This function is not measured.
+ typedef void (*BenchmarkSetupFunction)(void*);
/// Add a benchmark with 'name' to the suite. The first benchmark is assumed to
/// be the baseline. Reporting will be done relative to that.
@@ -58,7 +61,10 @@ class Benchmark {
/// initial_batch_size is the initial batch size to the run the function. The
/// harness function will automatically ramp up the batch_size. The benchmark
/// will take *at least* initial_batch_size * function invocation time.
- std::string Measure(int max_time = 50, int initial_batch_size = 10);
+ /// 'fn' is the setup function to be run before every iteration if provided and
+ /// it will not be measured.
+ std::string Measure(
+ int max_time = 50, int initial_batch_size = 10, BenchmarkSetupFunction fn = NULL);
/// Output machine/build configuration as a string
static std::string GetMachineInfo();
diff --git a/be/src/util/tagged-ptr-test.cc b/be/src/util/tagged-ptr-test.cc
new file mode 100644
index 0000000..7e81860
--- /dev/null
+++ b/be/src/util/tagged-ptr-test.cc
@@ -0,0 +1,169 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "util/tagged-ptr.h"
+#include <string>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include "testutil/gtest-util.h"
+
+namespace impala {
+
+class TaggedPtrTest {
+ public:
+ int id;
+ TaggedPtrTest(int i, const std::string& s) {
+ id = i;
+ str = s;
+ }
+
+ std::string GetString() { return str; }
+
+ bool operator==(const TaggedPtrTest& other) {
+ return id == other.id && str == other.str;
+ }
+
+ private:
+ std::string str;
+};
+
+TaggedPtr<TaggedPtrTest> MakeTaggedPtr(int a, const std::string& s) {
+ return TaggedPtr<TaggedPtrTest>::make_tagptr(a, s);
+}
+
+union TestData {
+ int x;
+ float y;
+ const char* s;
+};
+
+struct TestBucket; // Forward Declaration.
+
+union TestBucketData {
+ TestData data;
+ TestBucket* next;
+};
+
+class TaggedBucketData : public TaggedPtr<TestBucketData, false> {
+ public:
+ bool IsData() { return IsTagBitSet<0>(); }
+ void SetIsData() { SetTagBit<0>(); }
+ void UnsetIsData() { UnsetTagBit<0>(); }
+ TestBucketData* GetData() { return GetPtr(); }
+ void SetBucketData(uintptr_t address) { SetPtr((TestBucketData*)address); }
+};
+
+struct TestBucket {
+ int id;
+ TaggedBucketData bucketData;
+};
+
+TEST(TaggedPtrTest, Simple) {
+ auto ptr = MakeTaggedPtr(3, "test1");
+ // Test for non-null
+ EXPECT_FALSE(!ptr);
+
+ // Test dereference operator
+ EXPECT_EQ((*ptr).id, 3);
+ EXPECT_EQ(ptr->GetString(), std::string("test1"));
+
+ // Test initial tag
+ EXPECT_EQ(ptr.GetTag(), 0);
+
+ // Set/Unset all tag bits and check
+#pragma push_macro("TEST_ALL_TAG_BITS")
+#define TEST_ALL_TAG_BITS(ignore1, i, ignore2) \
+ ptr.SetTagBit<i>(); \
+ EXPECT_TRUE(ptr.IsTagBitSet<i>()); \
+ ptr.UnsetTagBit<i>(); \
+ EXPECT_FALSE(ptr.IsTagBitSet<i>());
+
+ BOOST_PP_REPEAT_FROM_TO(0, 6, TEST_ALL_TAG_BITS, ignore);
+#pragma pop_macro("TEST_ALL_TAG_BITS")
+
+ // Set few tag bits and check
+ ptr.SetTagBit<0>();
+ ptr.SetTagBit<1>();
+ EXPECT_TRUE(ptr.IsTagBitSet<0>());
+ EXPECT_TRUE(ptr.IsTagBitSet<1>());
+ EXPECT_FALSE(ptr.IsTagBitSet<2>());
+ EXPECT_EQ(ptr.GetTag(), 0X60);
+
+ // Unset Tag
+ ptr.UnsetTagBit<0>();
+ EXPECT_FALSE(ptr.IsTagBitSet<0>());
+ EXPECT_EQ(ptr.GetTag(), 0x20);
+
+ // Move Semantics
+ auto ptr_move1 = std::move(ptr);
+ EXPECT_FALSE(!ptr_move1);
+ EXPECT_TRUE(!ptr);
+ TaggedPtr<TaggedPtrTest> ptr_move2;
+ EXPECT_TRUE(!ptr_move2);
+ ptr_move2 = std::move(ptr_move1);
+ EXPECT_FALSE(!ptr_move2);
+}
+
+TEST(TaggedPtrTest, Comparision) {
+ auto ptr1 = MakeTaggedPtr(3, "test1");
+ auto ptr2 = MakeTaggedPtr(3, "test2");
+ auto ptr3 = MakeTaggedPtr(3, "test1");
+ ptr1.SetTagBit<1>();
+ ptr1.SetTagBit<2>();
+ ptr3.SetTagBit<1>();
+ ptr3.SetTagBit<2>();
+ EXPECT_FALSE(ptr1 == ptr3);
+ EXPECT_TRUE(ptr1 != ptr2);
+ EXPECT_TRUE(*ptr1 == *ptr3);
+ EXPECT_FALSE(*ptr1 == *ptr2);
+}
+TEST(TaggedPtrTest, Complex) {
+ // Check if tag bits are retained on setting Data
+ TestBucket tagTest;
+ tagTest.bucketData.SetIsData();
+ tagTest.bucketData.SetTagBit<1>();
+ TestBucketData tag_bucket_data;
+ tag_bucket_data.data.s = "TagTest";
+ tagTest.bucketData.SetBucketData((uintptr_t)&tag_bucket_data);
+ EXPECT_TRUE(tagTest.bucketData.IsData());
+ EXPECT_TRUE(tagTest.bucketData.IsTagBitSet<1>());
+ EXPECT_EQ(tagTest.bucketData.GetData()->data.s, "TagTest");
+ // set to null and check
+ tagTest.bucketData.SetBucketData(0);
+ EXPECT_TRUE(tagTest.bucketData.IsNull());
+ EXPECT_TRUE(tagTest.bucketData.IsData());
+ EXPECT_TRUE(tagTest.bucketData.IsTagBitSet<1>());
+
+ // Creating two buckets bucket1 and bucket2 and linking bucket2 to bucket1.
+ TestBucket bucket1;
+ bucket1.id = 1;
+ TestBucketData bucket_data;
+ bucket_data.data.s = "testString";
+ TestBucket bucket2;
+ bucket2.id = 2;
+ bucket2.bucketData.SetBucketData((uintptr_t)&bucket_data);
+ bucket2.bucketData.SetIsData();
+ TestBucketData bucket_data1;
+ bucket_data1.next = &bucket2;
+ bucket1.bucketData.SetBucketData((uintptr_t)&bucket_data1);
+
+ EXPECT_FALSE(bucket1.bucketData.IsData());
+ auto first_bd = bucket1.bucketData.GetData();
+ EXPECT_EQ(first_bd->next->id, 2);
+ auto second_bd = first_bd->next->bucketData.GetData();
+ EXPECT_EQ(second_bd->data.s, "testString");
+}
+}; // namespace impala
diff --git a/be/src/util/tagged-ptr.h b/be/src/util/tagged-ptr.h
new file mode 100644
index 0000000..ff89dd9
--- /dev/null
+++ b/be/src/util/tagged-ptr.h
@@ -0,0 +1,139 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <cstdint>
+#include <utility>
+#include "common/compiler-util.h"
+#include "common/logging.h"
+
+namespace impala {
+
+/// Most OS uses paging to translate linear address (address used by software) to actual
+/// physical address. Intel 64 bit processors restricts linear address to 48 bits and
+/// with paging level 5 will extend it to 57 bits. Pointers used to store these addresses
+/// are 64 bit long. 0 to 56 bits will be storing the linear address. Rest of the bits
+/// can be used to store extra information to save memory. For example booleans in
+/// buckets of HashTable can be folded into next pointer. But there is a caveat:
+/// Rest of the bits i.e., 57 to 63 needs to be identical and same as 56th bit. Hence, it
+/// is called 57-bit canonocal. address too. 48-bit canonical address is also 57-bit
+/// canonical. For 64-bit address, processor first confirms if it is in canonical format
+/// otherwise it would fail. This is the utility class that would help storing tags in
+/// pointer at bit positions 57..63. Tags are stored from most significant bit to lower
+/// bits. Tag bit 0 - corresponds to bit 63, bit 1 corresponds to 62 and so on.
+/// Another point to be noted is that User space in both X86 and ARM are in the lower
+/// half of virtual space so they will always have top bits as 0. For instance in AArch64
+/// Linux with 4KB pages with 4 levels (48-bit) user space is between
+/// 0000000000000000 - 0000ffffffffffff. This implementation assumes that.
+/// Note on inheritance:
+/// We can create it's derived classes, but virtual functions should not be declared here
+/// as that would include pointer to virtual table defeating the purpose of saving space.
+/// Derived class would be needed to define what each tag bit would mean or when
+/// allocation/deallocation of the object to which pointer stored points to should be
+/// the responsibility of client and not 'TaggedPtr'( check HashTable::TaggedBucketData).
+
+template <class T, bool OWNS = true>
+class TaggedPtr {
+ public:
+ TaggedPtr() = default;
+
+ template <class... Args>
+ static TaggedPtr make_tagptr(Args&&... args) {
+ T* ptr = new T(std::forward<Args>(args)...);
+ return TaggedPtr(ptr);
+ }
+
+ // Define move constructor and move assignment
+ TaggedPtr(TaggedPtr&& other) : data_(std::exchange(other.data_, 0)) {}
+ TaggedPtr<T, OWNS>& operator=(TaggedPtr<T, OWNS>&& other) noexcept {
+ if (this != &other) {
+ data_ = std::exchange(other.data_, 0);
+ }
+ return *this;
+ }
+
+ ~TaggedPtr() {
+ if (OWNS) {
+ // Cleanup if owning the pointer
+ T* ptr = GetPtr();
+ // will not work for arrays, but arrays are not yet supported.
+ if (ptr) delete ptr;
+ }
+ }
+
+ template <uint8_t bit>
+ static constexpr uintptr_t DATA_MASK = 1ULL << (63 - bit);
+
+ template <uint8_t bit>
+ static constexpr uintptr_t DATA_MASK_INVERSE = ~DATA_MASK<bit>;
+
+ template <uint8_t bit>
+ ALWAYS_INLINE void SetTagBit() {
+ static_assert(bit >= 0 && bit < 7, "'bit' must be in range 0 to 6 (inclusive).");
+ data_ = (data_ | DATA_MASK<bit>);
+ }
+
+ template <uint8_t bit>
+ ALWAYS_INLINE void UnsetTagBit() {
+ static_assert(bit >= 0 && bit < 7, "'bit' must be in range 0 to 6 (inclusive).");
+ data_ = (data_ & DATA_MASK_INVERSE<bit>);
+ }
+
+ template <uint8_t bit>
+ ALWAYS_INLINE bool IsTagBitSet() {
+ static_assert(bit >= 0 && bit < 7, "'bit' must be in range 0 to 6 (inclusive).");
+ return data_ & DATA_MASK<bit>;
+ }
+
+ ALWAYS_INLINE bool IsNull() { return GetPtr() == 0; }
+
+ ALWAYS_INLINE int GetTag() const { return data_ >> 57; }
+
+ ALWAYS_INLINE T* GetPtr() const { return (T*)(data_ & MASK_0_56_BITS); }
+
+ T& operator*() const noexcept { return *GetPtr(); }
+
+ T* operator->() const noexcept { return GetPtr(); }
+
+ bool operator!() const noexcept { return GetPtr() == 0; }
+
+ bool operator==(const TaggedPtr<T>& a) noexcept { return data_ == a.data_; }
+
+ bool operator!=(const TaggedPtr<T>& a) noexcept { return data_ != a.data_; }
+
+ private:
+ TaggedPtr(T* ptr) { SetPtr(ptr); }
+
+ uintptr_t data_ = 0;
+ static constexpr uintptr_t MASK_56_BIT = (1ULL << 56);
+ static constexpr uintptr_t MASK_0_56_BITS = (1ULL << 57) - 1;
+ static constexpr uintptr_t MASK_0_56_BITS_INVERSE = ~MASK_0_56_BITS;
+
+ protected:
+ // Don't use unless client wants to retain the ownership of pointer.
+ ALWAYS_INLINE void SetPtr(T* ptr) {
+ data_ = (data_ & MASK_0_56_BITS_INVERSE) | (reinterpret_cast<uintptr_t>(ptr));
+ }
+ ALWAYS_INLINE void SetData(uintptr_t data) { data_ = data; }
+ ALWAYS_INLINE uintptr_t GetData() { return data_; }
+ // No copies allowed to ensure no leaking of ownership.
+ // Derived classes can opt to enable it.
+ TaggedPtr(const TaggedPtr&) = default;
+ TaggedPtr& operator=(const TaggedPtr&) = default;
+};
+}; // namespace impala
\ No newline at end of file
diff --git a/fe/src/main/java/org/apache/impala/planner/PlannerContext.java b/fe/src/main/java/org/apache/impala/planner/PlannerContext.java
index 7b6d361..7d77678 100644
--- a/fe/src/main/java/org/apache/impala/planner/PlannerContext.java
+++ b/fe/src/main/java/org/apache/impala/planner/PlannerContext.java
@@ -39,9 +39,11 @@ public class PlannerContext {
public final static double HASH_TBL_SPACE_OVERHEAD = 1.1;
// Bucket is defined in the be/src/exec/hash-table.h
- public final static double SIZE_OF_BUCKET = 16;
+ // Also includes size of hash. Hash is stored in seperate array for
+ // every bucket of HashTable.
+ public final static double SIZE_OF_BUCKET = 12;
// DuplicateNode is defined in the be/src/exec/hash-table.h
- public final static double SIZE_OF_DUPLICATENODE = 24;
+ public final static double SIZE_OF_DUPLICATENODE = 16;
// Assumed average number of items in a nested collection, since we currently have no
// statistics on nested fields. The motivation for this constant is to avoid
diff --git a/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java b/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
index 328b897..e9b6eaa 100644
--- a/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
+++ b/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
@@ -892,18 +892,18 @@ public class CardinalityTest extends PlannerTestBase {
verifyApproxMemoryEstimate("SELECT COUNT(*),MAX(B.BIGINT_COL) FROM " +
"FUNCTIONAL.ALLTYPES A , FUNCTIONAL.ALLTYPESSMALL B, " +
"FUNCTIONAL.NULLROWS C GROUP BY A.ID, B.TIMESTAMP_COL,C.BOOL_NULLS",
- 2190000*(4+16+1+8+8+16), true, true, ImmutableSet.of(),
+ 2190000*(4+16+1+8+8+12), true, true, ImmutableSet.of(),
pathToFirstAggregationNode, AggregationNode.class);
verifyApproxMemoryEstimate("SELECT COUNT(*),MAX(B.BIGINT_COL) FROM " +
"FUNCTIONAL.ALLTYPES A , FUNCTIONAL.ALLTYPESSMALL B, " +
"FUNCTIONAL.NULLROWS C GROUP BY A.ID, B.TIMESTAMP_COL,C.BOOL_NULLS",
- 2190000*(4+16+1+8+8+16), true, false, ImmutableSet.of(),
+ 2190000*(4+16+1+8+8+12), true, false, ImmutableSet.of(),
pathToSecondAggregationNode, AggregationNode.class);
// create a single node plan.
verifyApproxMemoryEstimate("SELECT COUNT(*),MAX(B.BIGINT_COL) FROM " +
"FUNCTIONAL.ALLTYPES A , FUNCTIONAL.ALLTYPESSMALL B, " +
"FUNCTIONAL.NULLROWS C GROUP BY A.ID, B.TIMESTAMP_COL,C.BOOL_NULLS",
- 2190000*(4+16+1+8+8+16), false, false, ImmutableSet.of(),
+ 2190000*(4+16+1+8+8+12), false, false, ImmutableSet.of(),
pathToAggregationNode, AggregationNode.class);
List<Integer> countFirstAggregationNode = Arrays.asList();
@@ -951,13 +951,13 @@ public class CardinalityTest extends PlannerTestBase {
// FUNCTIONAL.ALLTYPES.DATE_STRING_COL's Ndv is 736 and avgRowSize is 8
// Cardinality estimate of subquery is 5372800
// BitUtil.roundUpToPowerOf2((long) Math.ceil(3 * Cardinality / 2)) is 8388608
- // Size of Bucket is 16.
+ // Size of Bucket is 12.
verifyApproxMemoryEstimate("SELECT A.ID FROM (SELECT A1.ID,B1.DATE_STRING_COL " +
"IDB FROM FUNCTIONAL.ALLTYPES A1 , FUNCTIONAL.ALLTYPES B1 GROUP BY A1.ID," +
"B1.DATE_STRING_COL) A JOIN (SELECT A1.ID,B1.DATE_STRING_COL IDB FROM " +
"FUNCTIONAL.ALLTYPES A1,FUNCTIONAL.ALLTYPES B1 GROUP BY " +
"A1.ID,B1.DATE_STRING_COL) B ON A.ID = B.ID AND A.IDB=B.IDB",
- 5372800*(4+8+4+8) + 8388608*16, true, true, ImmutableSet.of(),
+ 5372800*(4+8+4+8) + 8388608*12, true, true, ImmutableSet.of(),
pathToJoinNode, HashJoinNode.class);
// create a single node plan.
verifyApproxMemoryEstimate("SELECT A.ID FROM (SELECT A1.ID,B1.DATE_STRING_COL " +
@@ -965,27 +965,27 @@ public class CardinalityTest extends PlannerTestBase {
"B1.DATE_STRING_COL) A JOIN (SELECT A1.ID,B1.DATE_STRING_COL IDB FROM " +
"FUNCTIONAL.ALLTYPES A1,FUNCTIONAL.ALLTYPES B1 GROUP BY " +
"A1.ID,B1.DATE_STRING_COL) B ON A.ID = B.ID AND A.IDB=B.IDB",
- 5372800*(4+8+4+8) + 8388608*16, false, false, ImmutableSet.of(),
+ 5372800*(4+8+4+8) + 8388608*12, false, false, ImmutableSet.of(),
pathToJoinNodeSg, HashJoinNode.class);
// FUNCTIONAL.ALLTYPES.ID's Ndv is 7300 and avgRowSize is 4
// FUNCTIONAL.ALLTYPES.DATE_STRING_COL's Ndv is 736 and avgRowSize is 8
// Cardinality estimate of subquery is 53290000
// BitUtil.roundUpToPowerOf2((long) Math.ceil(3 * Cardinality / 2)) is 134217728
- // Size of Bucket is 16. Size of Duplicatenode is 24
+ // Size of Bucket is 12. Size of Duplicatenode is 16
// Ndv estimate of subquery is 5372800
verifyApproxMemoryEstimate("SELECT A.ID FROM (SELECT A1.ID,B1.DATE_STRING_COL " +
"IDB FROM FUNCTIONAL.ALLTYPES A1 , FUNCTIONAL.ALLTYPES B1) A JOIN " +
"(SELECT A1.ID,B1.DATE_STRING_COL IDB FROM FUNCTIONAL.ALLTYPES A1," +
"FUNCTIONAL.ALLTYPES B1) B ON A.ID = B.ID AND A.IDB=B.IDB",
- 53290000L*(4L+8L+4L+8L)+134217728L*16L+(53290000L-5372800L)*24L, true, true,
+ 53290000L*(4L+8L+4L+8L)+134217728L*12L+(53290000L-5372800L)*16L, true, true,
ImmutableSet.of(), pathToJoinNode, HashJoinNode.class);
// create a single node plan.
verifyApproxMemoryEstimate("SELECT A.ID FROM (SELECT A1.ID,B1.DATE_STRING_COL " +
"IDB FROM FUNCTIONAL.ALLTYPES A1 , FUNCTIONAL.ALLTYPES B1) A JOIN " +
"(SELECT A1.ID,B1.DATE_STRING_COL IDB FROM FUNCTIONAL.ALLTYPES A1," +
"FUNCTIONAL.ALLTYPES B1) B ON A.ID = B.ID AND A.IDB=B.IDB",
- 53290000L*(4L+8L+4L+8L)+134217728L*16L+(53290000L-5372800L)*24L, false, false,
+ 53290000L*(4L+8L+4L+8L)+134217728L*12L+(53290000L-5372800L)*16L, false, false,
ImmutableSet.of(), pathToJoinNodeSg, HashJoinNode.class);
}
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection-hdfs-num-rows-est-enabled.test b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection-hdfs-num-rows-est-enabled.test
index 4c9008b..8cc2ac8 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection-hdfs-num-rows-est-enabled.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection-hdfs-num-rows-est-enabled.test
@@ -19,7 +19,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF000[bloom] <- c_customer_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,1 row-size=8B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -60,7 +60,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF000[bloom] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,1 row-size=8B cardinality=7.99M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
index 75eb17b..1e8e6ec 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
@@ -292,7 +292,7 @@ PLAN-ROOT SINK
| hash predicates: sr_returned_date_sk = d2.d_date_sk
| fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
| runtime filters: RF002[bloom] <- d2.d_date_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=1,0,3,4 row-size=56B cardinality=8.13K
| in pipelines: 01(GETNEXT), 04(OPEN)
|
@@ -454,7 +454,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF000[bloom] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,1 row-size=8B cardinality=unavailable
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -497,7 +497,7 @@ PLAN-ROOT SINK
| hash predicates: ss_sold_time_sk = ws_sold_time_sk
| fk/pk conjuncts: none
| runtime filters: RF000[bloom] <- ws_sold_time_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2 row-size=104B cardinality=2.44M
| in pipelines: 00(GETNEXT), 02(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test b/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
index 0559ff9..42715d6 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
@@ -65,7 +65,7 @@ from tpch_parquet.lineitem
left join tpch_parquet.orders on l_orderkey = o_orderkey
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=126.00MB Threads=5
-Per-Host Resource Estimates: Memory=550MB
+Per-Host Resource Estimates: Memory=534MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.lineitem LEFT
OUTER JOIN tpch_parquet.orders ON l_orderkey = o_orderkey
@@ -81,11 +81,11 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=398.84MB mem-reservation=86.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=382.84MB mem-reservation=86.00MB thread-reservation=2
02:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
-| mem-estimate=308.49MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=292.49MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1N row-size=402B cardinality=6.00M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -122,7 +122,7 @@ select * from tpch_parquet.lineitem
where l_orderkey not in (select o_orderkey from tpch_parquet.orders)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=112.00MB Threads=5
-Per-Host Resource Estimates: Memory=320MB
+Per-Host Resource Estimates: Memory=304MB
Analyzed query: SELECT * FROM tpch_parquet.lineitem NULL AWARE LEFT ANTI JOIN
(SELECT o_orderkey FROM tpch_parquet.orders) `$a$1` (`$c$1`) ON l_orderkey =
`$a$1`.`$c$1`
@@ -139,10 +139,10 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=169.47MB mem-reservation=92.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=153.47MB mem-reservation=92.00MB thread-reservation=2
02:HASH JOIN [NULL AWARE LEFT ANTI JOIN, BROADCAST]
| hash predicates: l_orderkey = o_orderkey
-| mem-estimate=79.44MB mem-reservation=52.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=63.44MB mem-reservation=52.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0 row-size=231B cardinality=6.00M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -182,7 +182,7 @@ group by 1, 2
having count(*) = 1
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=156.00MB Threads=7
-Per-Host Resource Estimates: Memory=437MB
+Per-Host Resource Estimates: Memory=426MB
Analyzed query: SELECT /* +straight_join */ l_orderkey, o_orderstatus, count(*)
FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON o_orderkey =
l_orderkey GROUP BY l_orderkey, o_orderstatus HAVING count(*) = CAST(1 AS
@@ -200,12 +200,12 @@ PLAN-ROOT SINK
| in pipelines: 07(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(l_orderkey,o_orderstatus)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=77.19MB mem-reservation=46.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=71.23MB mem-reservation=46.00MB thread-reservation=1
07:AGGREGATE [FINALIZE]
| output: count:merge(*)
| group by: l_orderkey, o_orderstatus
| having: count(*) = CAST(1 AS BIGINT)
-| mem-estimate=67.10MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=61.13MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -215,11 +215,11 @@ Per-Host Resources: mem-estimate=77.19MB mem-reservation=46.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=128.86MB mem-reservation=81.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=123.37MB mem-reservation=81.00MB thread-reservation=1 runtime-filters-memory=1.00MB
03:AGGREGATE [STREAMING]
| output: count(*)
| group by: l_orderkey, o_orderstatus
-| mem-estimate=61.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=56.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 00(GETNEXT)
|
@@ -272,7 +272,7 @@ select distinct *
from tpch_parquet.lineitem
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=136.00MB Threads=4
-Per-Host Resource Estimates: Memory=1.00GB
+Per-Host Resource Estimates: Memory=1012MB
Analyzed query: SELECT DISTINCT * FROM tpch_parquet.lineitem
F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
@@ -287,10 +287,10 @@ PLAN-ROOT SINK
| in pipelines: 03(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(tpch_parquet.lineitem.l_orderkey,tpch_parquet.lineitem.l_partkey,tpch_parquet.lineitem.l_suppkey,tpch_parquet.lineitem.l_linenumber,tpch_parquet.lineitem.l_quantity,tpch_parquet.lineitem.l_extendedprice,tpch_parquet.lineitem.l_discount,tpch_parquet.lineitem.l_tax,tpch_parquet.lineitem.l_returnflag,tpch_parquet.lineitem.l_linestatus,tpch_parquet.lineitem.l_shipdate,tpch_parquet.lineitem.l_commitdate,tpch_parquet.lineitem.l_receiptdate,tpch_parquet.lineitem.l_shipin [...]
-Per-Host Resources: mem-estimate=481.48MB mem-reservation=46.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=473.84MB mem-reservation=46.00MB thread-reservation=1
03:AGGREGATE [FINALIZE]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=470.79MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=463.16MB mem-reservation=46.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 03(GETNEXT), 00(OPEN)
|
@@ -300,10 +300,10 @@ Per-Host Resources: mem-estimate=481.48MB mem-reservation=46.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=433.09MB mem-reservation=74.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=427.37MB mem-reservation=74.00MB thread-reservation=2
01:AGGREGATE [STREAMING]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=353.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=347.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 00(GETNEXT)
|
@@ -324,7 +324,7 @@ from tpch_parquet.lineitem
group by 1, 2
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=114.00MB Threads=4
-Per-Host Resource Estimates: Memory=347MB
+Per-Host Resource Estimates: Memory=334MB
Analyzed query: SELECT l_orderkey, l_partkey, group_concat(l_linestatus, ',')
FROM tpch_parquet.lineitem GROUP BY l_orderkey, l_partkey
@@ -340,11 +340,11 @@ PLAN-ROOT SINK
| in pipelines: 03(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(l_orderkey,l_partkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=94.03MB mem-reservation=48.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=86.40MB mem-reservation=48.00MB thread-reservation=1
03:AGGREGATE [FINALIZE]
| output: group_concat:merge(l_linestatus, ',')
| group by: l_orderkey, l_partkey
-| mem-estimate=83.94MB mem-reservation=48.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=76.31MB mem-reservation=48.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=28B cardinality=6.00M
| in pipelines: 03(GETNEXT), 00(OPEN)
|
@@ -354,11 +354,11 @@ Per-Host Resources: mem-estimate=94.03MB mem-reservation=48.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=142.96MB mem-reservation=50.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=137.23MB mem-reservation=50.00MB thread-reservation=2
01:AGGREGATE [STREAMING]
| output: group_concat(l_linestatus, ',')
| group by: l_orderkey, l_partkey
-| mem-estimate=62.96MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=57.23MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=28B cardinality=6.00M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
index 8981e6b..4be80f6 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
@@ -2002,12 +2002,12 @@ from tpch_parquet.lineitem
group by l_orderkey
---- PLAN
Max Per-Host Resource Reservation: Memory=38.00MB Threads=2
-Per-Host Resource Estimates: Memory=128MB
+Per-Host Resource Estimates: Memory=122MB
Analyzed query: SELECT l_orderkey, count(*) FROM tpch_parquet.lineitem GROUP BY
l_orderkey
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=127.71MB mem-reservation=38.00MB thread-reservation=2
+| Per-Host Resources: mem-estimate=121.75MB mem-reservation=38.00MB thread-reservation=2
PLAN-ROOT SINK
| output exprs: l_orderkey, count(*)
| mem-estimate=23.86MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -2015,7 +2015,7 @@ PLAN-ROOT SINK
01:AGGREGATE [FINALIZE]
| output: count(*)
| group by: l_orderkey
-| mem-estimate=47.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=41.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=16B cardinality=1.56M
| in pipelines: 01(GETNEXT), 00(OPEN)
|
@@ -2030,7 +2030,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=59.00MB Threads=4
-Per-Host Resource Estimates: Memory=183MB
+Per-Host Resource Estimates: Memory=177MB
Analyzed query: SELECT l_orderkey, count(*) FROM tpch_parquet.lineitem GROUP BY
l_orderkey
@@ -2060,11 +2060,11 @@ Per-Host Resources: mem-estimate=25.01MB mem-reservation=17.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=125.79MB mem-reservation=38.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=120.06MB mem-reservation=38.00MB thread-reservation=2
01:AGGREGATE [STREAMING]
| output: count(*)
| group by: l_orderkey
-| mem-estimate=45.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=40.06MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=16B cardinality=1.56M
| in pipelines: 00(GETNEXT)
|
@@ -2079,7 +2079,7 @@ Per-Host Resources: mem-estimate=125.79MB mem-reservation=38.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=59.00MB Threads=3
-Per-Host Resource Estimates: Memory=183MB
+Per-Host Resource Estimates: Memory=177MB
Analyzed query: SELECT l_orderkey, count(*) FROM tpch_parquet.lineitem GROUP BY
l_orderkey
@@ -2109,11 +2109,11 @@ Per-Instance Resources: mem-estimate=25.01MB mem-reservation=17.00MB thread-rese
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=125.79MB mem-reservation=38.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=120.06MB mem-reservation=38.00MB thread-reservation=1
01:AGGREGATE [STREAMING]
| output: count(*)
| group by: l_orderkey
-| mem-estimate=45.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=40.06MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=16B cardinality=1.56M
| in pipelines: 00(GETNEXT)
|
@@ -2634,12 +2634,12 @@ select *
from tpch.lineitem inner join tpch.orders on l_orderkey = o_orderkey
---- PLAN
Max Per-Host Resource Reservation: Memory=51.00MB Threads=3
-Per-Host Resource Estimates: Memory=497MB
+Per-Host Resource Estimates: Memory=481MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN tpch.orders ON l_orderkey
= o_orderkey
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=497.49MB mem-reservation=51.00MB thread-reservation=3 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=481.49MB mem-reservation=51.00MB thread-reservation=3 runtime-filters-memory=1.00MB
PLAN-ROOT SINK
| output exprs: tpch.lineitem.l_orderkey, tpch.lineitem.l_partkey, tpch.lineitem.l_suppkey, tpch.lineitem.l_linenumber, tpch.lineitem.l_quantity, tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.lineitem.l_tax, tpch.lineitem.l_returnflag, tpch.lineitem.l_linestatus, tpch.lineitem.l_shipdate, tpch.lineitem.l_commitdate, tpch.lineitem.l_receiptdate, tpch.lineitem.l_shipinstruct, tpch.lineitem.l_shipmode, tpch.lineitem.l_comment, tpch.orders.o_orderkey, tpch.orders.o_custkey, [...]
| mem-estimate=100.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -2648,7 +2648,7 @@ PLAN-ROOT SINK
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF000[bloom] <- o_orderkey
-| mem-estimate=308.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=292.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=402B cardinality=5.76M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -2674,7 +2674,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=55.00MB Threads=5
-Per-Host Resource Estimates: Memory=607MB
+Per-Host Resource Estimates: Memory=591MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN tpch.orders ON l_orderkey
= o_orderkey
@@ -2690,12 +2690,12 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=407.84MB mem-reservation=43.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=391.84MB mem-reservation=43.00MB thread-reservation=2 runtime-filters-memory=1.00MB
02:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF000[bloom] <- o_orderkey
-| mem-estimate=308.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=292.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=402B cardinality=5.76M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -2728,7 +2728,7 @@ Per-Host Resources: mem-estimate=407.84MB mem-reservation=43.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=98.00MB Threads=5
-Per-Host Resource Estimates: Memory=697MB
+Per-Host Resource Estimates: Memory=681MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN tpch.orders ON l_orderkey
= o_orderkey
@@ -2755,12 +2755,12 @@ Per-Instance Resources: mem-estimate=88.00MB mem-reservation=8.00MB thread-reser
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=319.84MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=303.84MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: o_orderkey
| | runtime filters: RF000[bloom] <- o_orderkey
-| | mem-estimate=308.49MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=292.49MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
| |
| 03:EXCHANGE [BROADCAST]
| | mem-estimate=10.34MB mem-reservation=0B thread-reservation=0
@@ -2795,12 +2795,12 @@ select *
from tpch.lineitem inner join /* +shuffle */ tpch.orders on l_orderkey = o_orderkey
---- PLAN
Max Per-Host Resource Reservation: Memory=51.00MB Threads=3
-Per-Host Resource Estimates: Memory=497MB
+Per-Host Resource Estimates: Memory=481MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN /* +shuffle */
tpch.orders ON l_orderkey = o_orderkey
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=497.49MB mem-reservation=51.00MB thread-reservation=3 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=481.49MB mem-reservation=51.00MB thread-reservation=3 runtime-filters-memory=1.00MB
PLAN-ROOT SINK
| output exprs: tpch.lineitem.l_orderkey, tpch.lineitem.l_partkey, tpch.lineitem.l_suppkey, tpch.lineitem.l_linenumber, tpch.lineitem.l_quantity, tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.lineitem.l_tax, tpch.lineitem.l_returnflag, tpch.lineitem.l_linestatus, tpch.lineitem.l_shipdate, tpch.lineitem.l_commitdate, tpch.lineitem.l_receiptdate, tpch.lineitem.l_shipinstruct, tpch.lineitem.l_shipmode, tpch.lineitem.l_comment, tpch.orders.o_orderkey, tpch.orders.o_custkey, [...]
| mem-estimate=100.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -2809,7 +2809,7 @@ PLAN-ROOT SINK
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF000[bloom] <- o_orderkey
-| mem-estimate=308.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=292.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=402B cardinality=5.76M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -2835,7 +2835,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=56.00MB Threads=6
-Per-Host Resource Estimates: Memory=413MB
+Per-Host Resource Estimates: Memory=408MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN /* +shuffle */
tpch.orders ON l_orderkey = o_orderkey
@@ -2851,12 +2851,12 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=124.86MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=119.53MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
02:HASH JOIN [INNER JOIN, PARTITIONED]
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF000[bloom] <- o_orderkey
-| mem-estimate=102.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=97.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=402B cardinality=5.76M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -2896,7 +2896,7 @@ Per-Host Resources: mem-estimate=89.00MB mem-reservation=9.00MB thread-reservati
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=99.00MB Threads=8
-Per-Host Resource Estimates: Memory=526MB
+Per-Host Resource Estimates: Memory=520MB
Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN /* +shuffle */
tpch.orders ON l_orderkey = o_orderkey
@@ -2922,12 +2922,12 @@ Per-Instance Resources: mem-estimate=11.38MB mem-reservation=0B thread-reservati
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F04:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=62.76MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=60.09MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: o_orderkey
| | runtime filters: RF000[bloom] <- o_orderkey
-| | mem-estimate=51.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=48.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| |
| 04:EXCHANGE [HASH(o_orderkey)]
| | mem-estimate=10.34MB mem-reservation=0B thread-reservation=0
@@ -3529,7 +3529,7 @@ from tpch_parquet.lineitem join tpch_parquet.orders on l_orderkey = o_orderkey
where l_shipmode = 'F'
---- PLAN
Max Per-Host Resource Reservation: Memory=99.00MB Threads=3
-Per-Host Resource Estimates: Memory=304MB
+Per-Host Resource Estimates: Memory=286MB
Analyzed query: SELECT DISTINCT l_orderkey, l_partkey, l_suppkey, l_linenumber,
l_comment FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON
l_orderkey = o_orderkey WHERE l_tax > CAST(10 AS DECIMAL(3,0)) UNION ALL SELECT
@@ -3540,7 +3540,7 @@ l_suppkey, l_linenumber, l_comment FROM tpch_parquet.lineitem INNER JOIN
tpch_parquet.orders ON l_orderkey = o_orderkey WHERE l_shipmode = 'F'
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=303.74MB mem-reservation=99.00MB thread-reservation=3 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=285.55MB mem-reservation=99.00MB thread-reservation=3 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_comment
| mem-estimate=100.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -3555,7 +3555,7 @@ PLAN-ROOT SINK
| | hash predicates: l_orderkey = o_orderkey
| | fk/pk conjuncts: l_orderkey = o_orderkey
| | runtime filters: RF004[bloom] <- o_orderkey
-| | mem-estimate=75.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=59.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=5,6 row-size=91B cardinality=822.53K
| | in pipelines: 08(GETNEXT), 09(OPEN)
| |
@@ -3587,7 +3587,7 @@ PLAN-ROOT SINK
| | hash predicates: l_orderkey = o_orderkey
| | fk/pk conjuncts: l_orderkey = o_orderkey
| | runtime filters: RF002[bloom] <- o_orderkey
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
| | tuple-ids=3,4 row-size=95B cardinality=1.15M
| | in pipelines: 05(GETNEXT), 06(OPEN)
| |
@@ -3617,7 +3617,7 @@ PLAN-ROOT SINK
|
04:AGGREGATE [FINALIZE]
| group by: l_orderkey, l_partkey, l_suppkey, l_linenumber, l_comment
-| mem-estimate=45.30MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=43.10MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=66B cardinality=575.77K
| in pipelines: 04(GETNEXT), 01(OPEN)
|
@@ -3625,7 +3625,7 @@ PLAN-ROOT SINK
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF000[bloom] <- o_orderkey
-| mem-estimate=75.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=59.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=82B cardinality=575.77K
| in pipelines: 01(GETNEXT), 02(OPEN)
|
@@ -3654,7 +3654,7 @@ PLAN-ROOT SINK
in pipelines: 01(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=157.00MB Threads=12
-Per-Host Resource Estimates: Memory=547MB
+Per-Host Resource Estimates: Memory=531MB
Analyzed query: SELECT DISTINCT l_orderkey, l_partkey, l_suppkey, l_linenumber,
l_comment FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON
l_orderkey = o_orderkey WHERE l_tax > CAST(10 AS DECIMAL(3,0)) UNION ALL SELECT
@@ -3676,7 +3676,7 @@ PLAN-ROOT SINK
| in pipelines: 14(GETNEXT), 05(GETNEXT), 08(GETNEXT)
|
F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=167.47MB mem-reservation=60.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=151.47MB mem-reservation=60.00MB thread-reservation=2 runtime-filters-memory=2.00MB
00:UNION
| pass-through-operands: 14
| mem-estimate=0B mem-reservation=0B thread-reservation=0
@@ -3687,7 +3687,7 @@ Per-Host Resources: mem-estimate=167.47MB mem-reservation=60.00MB thread-reserva
| | hash predicates: l_orderkey = o_orderkey
| | fk/pk conjuncts: l_orderkey = o_orderkey
| | runtime filters: RF004[bloom] <- o_orderkey
-| | mem-estimate=75.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=59.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=5,6 row-size=91B cardinality=822.53K
| | in pipelines: 08(GETNEXT), 09(OPEN)
| |
@@ -3726,7 +3726,7 @@ Per-Host Resources: mem-estimate=167.47MB mem-reservation=60.00MB thread-reserva
| | hash predicates: l_orderkey = o_orderkey
| | fk/pk conjuncts: l_orderkey = o_orderkey
| | runtime filters: RF002[bloom] <- o_orderkey
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
| | tuple-ids=3,4 row-size=95B cardinality=1.15M
| | in pipelines: 05(GETNEXT), 06(OPEN)
| |
@@ -3826,8 +3826,8 @@ Per-Host Resources: mem-estimate=81.00MB mem-reservation=25.00MB thread-reservat
tuple-ids=0 row-size=74B cardinality=600.12K
in pipelines: 01(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=261.00MB Threads=10
-Per-Host Resource Estimates: Memory=625MB
+Max Per-Host Resource Reservation: Memory=227.00MB Threads=10
+Per-Host Resource Estimates: Memory=583MB
Analyzed query: SELECT DISTINCT l_orderkey, l_partkey, l_suppkey, l_linenumber,
l_comment FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON
l_orderkey = o_orderkey WHERE l_tax > CAST(10 AS DECIMAL(3,0)) UNION ALL SELECT
@@ -3866,12 +3866,12 @@ Per-Instance Resources: mem-estimate=80.00MB mem-reservation=24.00MB thread-rese
| | in pipelines: 08(GETNEXT), 09(OPEN)
| |
| |--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=86.47MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=79.02MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=01 plan-id=02 cohort-id=01
| | | build expressions: o_orderkey
| | | runtime filters: RF004[bloom] <- o_orderkey
-| | | mem-estimate=75.44MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=68.00MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
| | |
| | 16:EXCHANGE [BROADCAST]
| | | mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
@@ -3908,17 +3908,17 @@ Per-Instance Resources: mem-estimate=80.00MB mem-reservation=24.00MB thread-rese
| | hash-table-id=00
| | hash predicates: l_orderkey = o_orderkey
| | fk/pk conjuncts: l_orderkey = o_orderkey
-| | mem-estimate=0B mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
| | tuple-ids=3,4 row-size=95B cardinality=1.15M
| | in pipelines: 05(GETNEXT), 06(OPEN)
| |
| |--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=77.19MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=43.19MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=00 plan-id=01 cohort-id=01
| | | build expressions: o_orderkey
| | | runtime filters: RF002[bloom] <- o_orderkey
-| | | mem-estimate=68.00MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB thread-reservation=0
| | |
| | 15:EXCHANGE [BROADCAST]
| | | mem-estimate=8.19MB mem-reservation=0B thread-reservation=0
@@ -4062,7 +4062,7 @@ order by
limit 100
---- PLAN
Max Per-Host Resource Reservation: Memory=120.50MB Threads=5
-Per-Host Resource Estimates: Memory=505MB
+Per-Host Resource Estimates: Memory=483MB
Analyzed query: SELECT c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice,
sum(l_quantity) FROM tpch.customer, tpch.orders, tpch.lineitem LEFT SEMI JOIN
(SELECT l_orderkey FROM tpch.lineitem GROUP BY l_orderkey HAVING sum(l_quantity)
@@ -4072,7 +4072,7 @@ c_custkey, o_orderkey, o_orderdate, o_totalprice ORDER BY o_totalprice DESC,
o_orderdate ASC LIMIT CAST(100 AS TINYINT)
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=505.44MB mem-reservation=120.50MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=483.48MB mem-reservation=120.50MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -4086,7 +4086,7 @@ PLAN-ROOT SINK
08:AGGREGATE [FINALIZE]
| output: sum(l_quantity)
| group by: c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
-| mem-estimate=61.81MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=59.52MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=6 row-size=92B cardinality=600.12K
| in pipelines: 08(GETNEXT), 02(OPEN)
|
@@ -4101,7 +4101,7 @@ PLAN-ROOT SINK
| | output: sum(l_quantity)
| | group by: l_orderkey
| | having: sum(l_quantity) > CAST(300 AS DECIMAL(5,0))
-| | mem-estimate=59.64MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=53.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=4 row-size=24B cardinality=156.34K
| | in pipelines: 04(GETNEXT), 03(OPEN)
| |
@@ -4137,7 +4137,7 @@ PLAN-ROOT SINK
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF004[bloom] <- o_orderkey
-| mem-estimate=129.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=113.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2,1 row-size=62B cardinality=5.76M
| in pipelines: 02(GETNEXT), 01(OPEN)
|
@@ -4164,7 +4164,7 @@ PLAN-ROOT SINK
in pipelines: 02(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=217.75MB Threads=11
-Per-Host Resource Estimates: Memory=556MB
+Per-Host Resource Estimates: Memory=544MB
Analyzed query: SELECT c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice,
sum(l_quantity) FROM tpch.customer, tpch.orders, tpch.lineitem LEFT SEMI JOIN
(SELECT l_orderkey FROM tpch.lineitem GROUP BY l_orderkey HAVING sum(l_quantity)
@@ -4207,7 +4207,7 @@ Per-Host Resources: mem-estimate=44.28MB mem-reservation=34.00MB thread-reservat
| in pipelines: 02(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=149.98MB mem-reservation=109.75MB thread-reservation=1 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=144.65MB mem-reservation=109.75MB thread-reservation=1 runtime-filters-memory=3.00MB
08:AGGREGATE [STREAMING]
| output: sum(l_quantity)
| group by: c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
@@ -4236,11 +4236,11 @@ Per-Host Resources: mem-estimate=149.98MB mem-reservation=109.75MB thread-reserv
| | in pipelines: 03(GETNEXT)
| |
| F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=145.23MB mem-reservation=42.00MB thread-reservation=2
+| Per-Host Resources: mem-estimate=139.51MB mem-reservation=42.00MB thread-reservation=2
| 04:AGGREGATE [STREAMING]
| | output: sum(l_quantity)
| | group by: l_orderkey
-| | mem-estimate=57.23MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=51.51MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=4 row-size=24B cardinality=1.56M
| | in pipelines: 03(GETNEXT)
| |
@@ -4283,7 +4283,7 @@ Per-Host Resources: mem-estimate=149.98MB mem-reservation=109.75MB thread-reserv
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
| runtime filters: RF004[bloom] <- o_orderkey
-| mem-estimate=43.27MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=37.93MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2,1 row-size=62B cardinality=5.76M
| in pipelines: 02(GETNEXT), 01(OPEN)
|
@@ -5355,7 +5355,7 @@ join (
) v1 on v1.k3 = t1.o_orderkey
---- PLAN
Max Per-Host Resource Reservation: Memory=103.00MB Threads=5
-Per-Host Resource Estimates: Memory=285MB
+Per-Host Resource Estimates: Memory=253MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.orders t1 INNER
JOIN (SELECT /* +straight_join */ t2.o_orderkey k2, k3, k4 FROM
tpch_parquet.orders t2 INNER JOIN (SELECT /* +straight_join */ t3.o_orderkey k3,
@@ -5364,7 +5364,7 @@ ON t3.o_orderkey = t4.o_orderkey) v2 ON v2.k3 = t2.o_orderkey) v1 ON v1.k3 =
t1.o_orderkey
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=285.33MB mem-reservation=103.00MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=253.33MB mem-reservation=103.00MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: t1.o_orderkey, t1.o_custkey, t1.o_orderstatus, t1.o_totalprice, t1.o_orderdate, t1.o_orderpriority, t1.o_clerk, t1.o_shippriority, t1.o_comment, t2.o_orderkey, t3.o_orderkey, t4.o_orderkey
| mem-estimate=100.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -5373,7 +5373,7 @@ PLAN-ROOT SINK
| hash predicates: t1.o_orderkey = t3.o_orderkey
| fk/pk conjuncts: t1.o_orderkey = t3.o_orderkey
| runtime filters: RF000[bloom] <- t3.o_orderkey
-| mem-estimate=98.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=82.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1,2,3 row-size=195B cardinality=1.50M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -5381,7 +5381,7 @@ PLAN-ROOT SINK
| | hash predicates: t2.o_orderkey = t3.o_orderkey
| | fk/pk conjuncts: t2.o_orderkey = t3.o_orderkey
| | runtime filters: RF002[bloom] <- t3.o_orderkey
-| | mem-estimate=86.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=70.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=1,2,3 row-size=24B cardinality=1.50M
| | in pipelines: 01(GETNEXT), 02(OPEN)
| |
@@ -5389,7 +5389,7 @@ PLAN-ROOT SINK
| | | hash predicates: t3.o_orderkey = t4.o_orderkey
| | | fk/pk conjuncts: t3.o_orderkey = t4.o_orderkey
| | | runtime filters: RF004[bloom] <- t4.o_orderkey
-| | | mem-estimate=75.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=59.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=2,3 row-size=16B cardinality=1.50M
| | | in pipelines: 02(GETNEXT), 03(OPEN)
| | |
@@ -5437,7 +5437,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=147.00MB Threads=10
-Per-Host Resource Estimates: Memory=476MB
+Per-Host Resource Estimates: Memory=449MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.orders t1 INNER
JOIN (SELECT /* +straight_join */ t2.o_orderkey k2, k3, k4 FROM
tpch_parquet.orders t2 INNER JOIN (SELECT /* +straight_join */ t3.o_orderkey k3,
@@ -5457,12 +5457,12 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=149.40MB mem-reservation=59.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=133.40MB mem-reservation=59.00MB thread-reservation=2 runtime-filters-memory=1.00MB
06:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: t1.o_orderkey = t3.o_orderkey
| fk/pk conjuncts: t1.o_orderkey = t3.o_orderkey
| runtime filters: RF000[bloom] <- t3.o_orderkey
-| mem-estimate=98.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=82.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1,2,3 row-size=195B cardinality=1.50M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -5472,12 +5472,12 @@ Per-Host Resources: mem-estimate=149.40MB mem-reservation=59.00MB thread-reserva
| | in pipelines: 01(GETNEXT)
| |
| F04:PLAN FRAGMENT [HASH(t3.o_orderkey)] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=94.66MB mem-reservation=70.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=82.94MB mem-reservation=70.00MB thread-reservation=1 runtime-filters-memory=2.00MB
| 05:HASH JOIN [INNER JOIN, PARTITIONED]
| | hash predicates: t2.o_orderkey = t3.o_orderkey
| | fk/pk conjuncts: t2.o_orderkey = t3.o_orderkey
| | runtime filters: RF002[bloom] <- t3.o_orderkey
-| | mem-estimate=43.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=35.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=1,2,3 row-size=24B cardinality=1.50M
| | in pipelines: 01(GETNEXT), 02(OPEN)
| |
@@ -5485,7 +5485,7 @@ Per-Host Resources: mem-estimate=149.40MB mem-reservation=59.00MB thread-reserva
| | | hash predicates: t3.o_orderkey = t4.o_orderkey
| | | fk/pk conjuncts: t3.o_orderkey = t4.o_orderkey
| | | runtime filters: RF004[bloom] <- t4.o_orderkey
-| | | mem-estimate=37.72MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=2,3 row-size=16B cardinality=1.50M
| | | in pipelines: 02(GETNEXT), 03(OPEN)
| | |
@@ -5554,7 +5554,7 @@ Per-Host Resources: mem-estimate=149.40MB mem-reservation=59.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=182.00MB Threads=9
-Per-Host Resource Estimates: Memory=483MB
+Per-Host Resource Estimates: Memory=455MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.orders t1 INNER
JOIN (SELECT /* +straight_join */ t2.o_orderkey k2, k3, k4 FROM
tpch_parquet.orders t2 INNER JOIN (SELECT /* +straight_join */ t3.o_orderkey k3,
@@ -5585,12 +5585,12 @@ Per-Instance Resources: mem-estimate=40.00MB mem-reservation=24.00MB thread-rese
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F06:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| | Per-Instance Resources: mem-estimate=109.40MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=93.40MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: t3.o_orderkey
| | runtime filters: RF000[bloom] <- t3.o_orderkey
-| | mem-estimate=98.33MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=82.33MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
| |
| 10:EXCHANGE [BROADCAST]
| | mem-estimate=10.07MB mem-reservation=0B thread-reservation=0
@@ -5608,12 +5608,12 @@ Per-Instance Resources: mem-estimate=40.00MB mem-reservation=24.00MB thread-rese
| | in pipelines: 01(GETNEXT), 02(OPEN)
| |
| |--F07:PLAN FRAGMENT [HASH(t3.o_orderkey)] hosts=2 instances=2
-| | | Per-Instance Resources: mem-estimate=50.19MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=42.19MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=01 plan-id=02 cohort-id=02
| | | build expressions: t3.o_orderkey
| | | runtime filters: RF002[bloom] <- t3.o_orderkey
-| | | mem-estimate=43.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=35.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | |
| | 04:HASH JOIN [INNER JOIN, PARTITIONED]
| | | hash-table-id=02
@@ -5624,12 +5624,12 @@ Per-Instance Resources: mem-estimate=40.00MB mem-reservation=24.00MB thread-rese
| | | in pipelines: 02(GETNEXT), 03(OPEN)
| | |
| | |--F08:PLAN FRAGMENT [HASH(t3.o_orderkey)] hosts=2 instances=2
-| | | | Per-Instance Resources: mem-estimate=44.47MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | | Per-Instance Resources: mem-estimate=40.75MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| | | JOIN BUILD
| | | | join-table-id=02 plan-id=03 cohort-id=03
| | | | build expressions: t4.o_orderkey
| | | | runtime filters: RF004[bloom] <- t4.o_orderkey
-| | | | mem-estimate=37.72MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | |
| | | 08:EXCHANGE [HASH(t4.o_orderkey)]
| | | | mem-estimate=5.75MB mem-reservation=0B thread-reservation=0
@@ -6155,12 +6155,12 @@ from tpch_parquet.lineitem
limit 5
---- PLAN
Max Per-Host Resource Reservation: Memory=74.00MB Threads=2
-Per-Host Resource Estimates: Memory=1.46GB
+Per-Host Resource Estimates: Memory=1.44GB
Analyzed query: SELECT DISTINCT * FROM tpch_parquet.lineitem LIMIT CAST(5 AS
TINYINT)
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=1.46GB mem-reservation=74.00MB thread-reservation=2
+| Per-Host Resources: mem-estimate=1.44GB mem-reservation=74.00MB thread-reservation=2
PLAN-ROOT SINK
| output exprs: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -6168,7 +6168,7 @@ PLAN-ROOT SINK
01:AGGREGATE [FINALIZE]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
| limit: 5
-| mem-estimate=1.38GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=1.36GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=5
| in pipelines: 01(GETNEXT), 00(OPEN)
|
@@ -6183,7 +6183,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=112.00MB Threads=4
-Per-Host Resource Estimates: Memory=919MB
+Per-Host Resource Estimates: Memory=905MB
Analyzed query: SELECT DISTINCT * FROM tpch_parquet.lineitem LIMIT CAST(5 AS
TINYINT)
@@ -6200,11 +6200,11 @@ PLAN-ROOT SINK
| in pipelines: 03(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(tpch_parquet.lineitem.l_orderkey,tpch_parquet.lineitem.l_partkey,tpch_parquet.lineitem.l_suppkey,tpch_parquet.lineitem.l_linenumber,tpch_parquet.lineitem.l_quantity,tpch_parquet.lineitem.l_extendedprice,tpch_parquet.lineitem.l_discount,tpch_parquet.lineitem.l_tax,tpch_parquet.lineitem.l_returnflag,tpch_parquet.lineitem.l_linestatus,tpch_parquet.lineitem.l_shipdate,tpch_parquet.lineitem.l_commitdate,tpch_parquet.lineitem.l_receiptdate,tpch_parquet.lineitem.l_shipin [...]
-Per-Host Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=473.84MB mem-reservation=34.00MB thread-reservation=1
03:AGGREGATE [FINALIZE]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
| limit: 5
-| mem-estimate=470.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=463.16MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=5
| in pipelines: 03(GETNEXT), 00(OPEN)
|
@@ -6214,10 +6214,10 @@ Per-Host Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=433.09MB mem-reservation=74.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=427.37MB mem-reservation=74.00MB thread-reservation=2
01:AGGREGATE [STREAMING]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=353.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=347.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/spillable-buffer-sizing.test b/testdata/workloads/functional-planner/queries/PlannerTest/spillable-buffer-sizing.test
index 9ef064d..63d87b6 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/spillable-buffer-sizing.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/spillable-buffer-sizing.test
@@ -126,7 +126,7 @@ from tpch_parquet.lineitem
left join tpch_parquet.orders on l_orderkey = o_orderkey
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=102.00MB Threads=5
-Per-Host Resource Estimates: Memory=550MB
+Per-Host Resource Estimates: Memory=534MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.lineitem LEFT
OUTER JOIN tpch_parquet.orders ON l_orderkey = o_orderkey
@@ -142,11 +142,11 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=398.84MB mem-reservation=74.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=382.84MB mem-reservation=74.00MB thread-reservation=2
02:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
| hash predicates: l_orderkey = o_orderkey
| fk/pk conjuncts: l_orderkey = o_orderkey
-| mem-estimate=308.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=292.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1N row-size=402B cardinality=6.00M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -178,7 +178,7 @@ Per-Host Resources: mem-estimate=398.84MB mem-reservation=74.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=136.00MB Threads=4
-Per-Host Resource Estimates: Memory=550MB
+Per-Host Resource Estimates: Memory=534MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.lineitem LEFT
OUTER JOIN tpch_parquet.orders ON l_orderkey = o_orderkey
@@ -204,11 +204,11 @@ Per-Instance Resources: mem-estimate=80.00MB mem-reservation=40.00MB thread-rese
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=318.84MB mem-reservation=68.00MB thread-reservation=1
+| | Per-Instance Resources: mem-estimate=302.84MB mem-reservation=68.00MB thread-reservation=1
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: o_orderkey
-| | mem-estimate=308.49MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=292.49MB mem-reservation=68.00MB spill-buffer=2.00MB thread-reservation=0
| |
| 03:EXCHANGE [BROADCAST]
| | mem-estimate=10.34MB mem-reservation=0B thread-reservation=0
@@ -379,7 +379,7 @@ from tpch_parquet.orders
join /*+broadcast*/ tpch_parquet.customer on o_custkey = c_custkey
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=79.00MB Threads=5
-Per-Host Resource Estimates: Memory=221MB
+Per-Host Resource Estimates: Memory=220MB
Analyzed query: SELECT /* +straight_join */ * FROM tpch_parquet.orders INNER
JOIN /* +broadcast */ tpch_parquet.customer ON o_custkey = c_custkey
@@ -395,12 +395,12 @@ PLAN-ROOT SINK
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=86.34MB mem-reservation=59.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=85.34MB mem-reservation=59.00MB thread-reservation=2 runtime-filters-memory=1.00MB
02:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: o_custkey = c_custkey
| fk/pk conjuncts: o_custkey = c_custkey
| runtime filters: RF000[bloom] <- c_custkey
-| mem-estimate=35.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=0,1 row-size=388B cardinality=1.50M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -731,7 +731,7 @@ group by 1, 2
having count(*) = 1
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=120.00MB Threads=7
-Per-Host Resource Estimates: Memory=425MB
+Per-Host Resource Estimates: Memory=414MB
Analyzed query: SELECT /* +straight_join */ l_orderkey, o_orderstatus, count(*)
FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON o_orderkey =
l_orderkey GROUP BY l_orderkey, o_orderstatus HAVING count(*) = CAST(1 AS
@@ -749,12 +749,12 @@ PLAN-ROOT SINK
| in pipelines: 07(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(l_orderkey,o_orderstatus)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=77.19MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=71.23MB mem-reservation=34.00MB thread-reservation=1
07:AGGREGATE [FINALIZE]
| output: count:merge(*)
| group by: l_orderkey, o_orderstatus
| having: count(*) = CAST(1 AS BIGINT)
-| mem-estimate=67.10MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=61.13MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -764,11 +764,11 @@ Per-Host Resources: mem-estimate=77.19MB mem-reservation=34.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=116.86MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=111.37MB mem-reservation=69.00MB thread-reservation=1 runtime-filters-memory=1.00MB
03:AGGREGATE [STREAMING]
| output: count(*)
| group by: l_orderkey, o_orderstatus
-| mem-estimate=61.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=56.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 00(GETNEXT)
|
@@ -816,7 +816,7 @@ Per-Host Resources: mem-estimate=81.00MB mem-reservation=5.00MB thread-reservati
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=120.00MB Threads=6
-Per-Host Resource Estimates: Memory=425MB
+Per-Host Resource Estimates: Memory=414MB
Analyzed query: SELECT /* +straight_join */ l_orderkey, o_orderstatus, count(*)
FROM tpch_parquet.lineitem INNER JOIN tpch_parquet.orders ON o_orderkey =
l_orderkey GROUP BY l_orderkey, o_orderstatus HAVING count(*) = CAST(1 AS
@@ -834,12 +834,12 @@ PLAN-ROOT SINK
| in pipelines: 07(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(l_orderkey,o_orderstatus)] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=77.19MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=71.23MB mem-reservation=34.00MB thread-reservation=1
07:AGGREGATE [FINALIZE]
| output: count:merge(*)
| group by: l_orderkey, o_orderstatus
| having: count(*) = CAST(1 AS BIGINT)
-| mem-estimate=67.10MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=61.13MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -849,11 +849,11 @@ Per-Instance Resources: mem-estimate=77.19MB mem-reservation=34.00MB thread-rese
| in pipelines: 00(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=71.81MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=66.32MB mem-reservation=34.00MB thread-reservation=1
03:AGGREGATE [STREAMING]
| output: count(*)
| group by: l_orderkey, o_orderstatus
-| mem-estimate=61.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=56.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=29B cardinality=4.69M
| in pipelines: 00(GETNEXT)
|
@@ -914,7 +914,7 @@ select distinct *
from tpch_parquet.lineitem
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=112.00MB Threads=4
-Per-Host Resource Estimates: Memory=1.00GB
+Per-Host Resource Estimates: Memory=1012MB
Analyzed query: SELECT DISTINCT * FROM tpch_parquet.lineitem
F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
@@ -929,10 +929,10 @@ PLAN-ROOT SINK
| in pipelines: 03(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(tpch_parquet.lineitem.l_orderkey,tpch_parquet.lineitem.l_partkey,tpch_parquet.lineitem.l_suppkey,tpch_parquet.lineitem.l_linenumber,tpch_parquet.lineitem.l_quantity,tpch_parquet.lineitem.l_extendedprice,tpch_parquet.lineitem.l_discount,tpch_parquet.lineitem.l_tax,tpch_parquet.lineitem.l_returnflag,tpch_parquet.lineitem.l_linestatus,tpch_parquet.lineitem.l_shipdate,tpch_parquet.lineitem.l_commitdate,tpch_parquet.lineitem.l_receiptdate,tpch_parquet.lineitem.l_shipin [...]
-Per-Host Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=473.84MB mem-reservation=34.00MB thread-reservation=1
03:AGGREGATE [FINALIZE]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=470.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=463.16MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 03(GETNEXT), 00(OPEN)
|
@@ -942,10 +942,10 @@ Per-Host Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=433.09MB mem-reservation=74.00MB thread-reservation=2
+Per-Host Resources: mem-estimate=427.37MB mem-reservation=74.00MB thread-reservation=2
01:AGGREGATE [STREAMING]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=353.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=347.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 00(GETNEXT)
|
@@ -960,7 +960,7 @@ Per-Host Resources: mem-estimate=433.09MB mem-reservation=74.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=112.00MB Threads=3
-Per-Host Resource Estimates: Memory=1.00GB
+Per-Host Resource Estimates: Memory=1012MB
Analyzed query: SELECT DISTINCT * FROM tpch_parquet.lineitem
F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
@@ -975,10 +975,10 @@ PLAN-ROOT SINK
| in pipelines: 03(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(tpch_parquet.lineitem.l_orderkey,tpch_parquet.lineitem.l_partkey,tpch_parquet.lineitem.l_suppkey,tpch_parquet.lineitem.l_linenumber,tpch_parquet.lineitem.l_quantity,tpch_parquet.lineitem.l_extendedprice,tpch_parquet.lineitem.l_discount,tpch_parquet.lineitem.l_tax,tpch_parquet.lineitem.l_returnflag,tpch_parquet.lineitem.l_linestatus,tpch_parquet.lineitem.l_shipdate,tpch_parquet.lineitem.l_commitdate,tpch_parquet.lineitem.l_receiptdate,tpch_parquet.lineitem.l_shipin [...]
-Per-Instance Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=473.84MB mem-reservation=34.00MB thread-reservation=1
03:AGGREGATE [FINALIZE]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=470.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=463.16MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 03(GETNEXT), 00(OPEN)
|
@@ -988,10 +988,10 @@ Per-Instance Resources: mem-estimate=481.48MB mem-reservation=34.00MB thread-res
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=433.09MB mem-reservation=74.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=427.37MB mem-reservation=74.00MB thread-reservation=1
01:AGGREGATE [STREAMING]
| group by: tpch_parquet.lineitem.l_orderkey, tpch_parquet.lineitem.l_partkey, tpch_parquet.lineitem.l_suppkey, tpch_parquet.lineitem.l_linenumber, tpch_parquet.lineitem.l_quantity, tpch_parquet.lineitem.l_extendedprice, tpch_parquet.lineitem.l_discount, tpch_parquet.lineitem.l_tax, tpch_parquet.lineitem.l_returnflag, tpch_parquet.lineitem.l_linestatus, tpch_parquet.lineitem.l_shipdate, tpch_parquet.lineitem.l_commitdate, tpch_parquet.lineitem.l_receiptdate, tpch_parquet.lineitem.l_ship [...]
-| mem-estimate=353.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=347.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1 row-size=231B cardinality=6.00M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test
index 4ad01d4..6e26ce0 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test
@@ -23,10 +23,10 @@ WHERE ctr1.ctr_total_return >
ORDER BY c_customer_id
LIMIT 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=30.33MB Threads=7
+Max Per-Host Resource Reservation: Memory=26.58MB Threads=7
Per-Host Resource Estimates: Memory=331MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=330.81MB mem-reservation=30.33MB thread-reservation=7 runtime-filters-memory=5.00MB
+| Per-Host Resources: mem-estimate=330.81MB mem-reservation=26.58MB thread-reservation=7 runtime-filters-memory=5.00MB
PLAN-ROOT SINK
| output exprs: c_customer_id
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -55,7 +55,7 @@ PLAN-ROOT SINK
| 09:AGGREGATE [FINALIZE]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=8 row-size=24B cardinality=53.81K
| | in pipelines: 09(GETNEXT), 06(OPEN)
| |
@@ -124,7 +124,7 @@ PLAN-ROOT SINK
|--03:AGGREGATE [FINALIZE]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=2 row-size=24B cardinality=53.81K
| | in pipelines: 03(GETNEXT), 00(OPEN)
| |
@@ -171,7 +171,7 @@ PLAN-ROOT SINK
tuple-ids=5 row-size=32B cardinality=100.00K
in pipelines: 05(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=54.95MB Threads=16
+Max Per-Host Resource Reservation: Memory=49.20MB Threads=16
Per-Host Resource Estimates: Memory=408MB
F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
@@ -222,7 +222,7 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
| | in pipelines: 22(GETNEXT)
| |
| F07:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=21.26MB mem-reservation=6.75MB thread-reservation=1
+| Per-Host Resources: mem-estimate=21.26MB mem-reservation=4.88MB thread-reservation=1
| 10:AGGREGATE [STREAMING]
| | output: avg(sum(sr_return_amt))
| | group by: sr_store_sk
@@ -233,7 +233,7 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
| 22:AGGREGATE [FINALIZE]
| | output: sum:merge(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=8 row-size=24B cardinality=53.81K
| | in pipelines: 22(GETNEXT), 06(OPEN)
| |
@@ -243,11 +243,11 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
| | in pipelines: 06(GETNEXT)
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=108.95MB mem-reservation=9.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=108.95MB mem-reservation=8.94MB thread-reservation=2 runtime-filters-memory=1.00MB
| 09:AGGREGATE [STREAMING]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=8 row-size=24B cardinality=53.81K
| | in pipelines: 06(GETNEXT)
| |
@@ -333,11 +333,11 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
| | in pipelines: 17(GETNEXT)
| |
| F03:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=11.26MB mem-reservation=4.75MB thread-reservation=1
+| Per-Host Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
| 17:AGGREGATE [FINALIZE]
| | output: sum:merge(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=2 row-size=24B cardinality=53.81K
| | in pipelines: 17(GETNEXT), 00(OPEN)
| |
@@ -347,11 +347,11 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
| | in pipelines: 00(GETNEXT)
| |
| F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=110.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=110.95MB mem-reservation=10.94MB thread-reservation=2 runtime-filters-memory=3.00MB
| 03:AGGREGATE [STREAMING]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=2 row-size=24B cardinality=53.81K
| | in pipelines: 00(GETNEXT)
| |
@@ -405,7 +405,7 @@ Per-Host Resources: mem-estimate=44.92MB mem-reservation=13.62MB thread-reservat
tuple-ids=5 row-size=32B cardinality=100.00K
in pipelines: 05(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=70.45MB Threads=15
+Max Per-Host Resource Reservation: Memory=64.70MB Threads=15
Per-Host Resource Estimates: Memory=216MB
F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
@@ -465,7 +465,7 @@ Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reser
| | in pipelines: 22(GETNEXT)
| |
| F07:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
-| Per-Instance Resources: mem-estimate=21.26MB mem-reservation=6.75MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=21.26MB mem-reservation=4.88MB thread-reservation=1
| 10:AGGREGATE [STREAMING]
| | output: avg(sum(sr_return_amt))
| | group by: sr_store_sk
@@ -476,7 +476,7 @@ Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reser
| 22:AGGREGATE [FINALIZE]
| | output: sum:merge(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=8 row-size=24B cardinality=53.81K
| | in pipelines: 22(GETNEXT), 06(OPEN)
| |
@@ -487,11 +487,11 @@ Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reser
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
-| Per-Instance Resources: mem-estimate=34.00MB mem-reservation=7.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=34.00MB mem-reservation=6.00MB thread-reservation=1
| 09:AGGREGATE [STREAMING]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=8 row-size=24B cardinality=53.81K
| | in pipelines: 06(GETNEXT)
| |
@@ -602,11 +602,11 @@ Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reser
| | in pipelines: 17(GETNEXT)
| |
| F03:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
-| Per-Instance Resources: mem-estimate=11.26MB mem-reservation=4.75MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
| 17:AGGREGATE [FINALIZE]
| | output: sum:merge(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=2 row-size=24B cardinality=53.81K
| | in pipelines: 17(GETNEXT), 00(OPEN)
| |
@@ -617,11 +617,11 @@ Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reser
| |
| F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
| Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
-| Per-Instance Resources: mem-estimate=34.00MB mem-reservation=7.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=34.00MB mem-reservation=6.00MB thread-reservation=1
| 03:AGGREGATE [STREAMING]
| | output: sum(sr_return_amt)
| | group by: sr_customer_sk, sr_store_sk
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=2 row-size=24B cardinality=53.81K
| | in pipelines: 00(GETNEXT)
| |
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test
index a1bd3d8..e1af9fb 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test
@@ -119,10 +119,10 @@ ORDER BY t_s_secyear.customer_id,
t_s_secyear.customer_preferred_cust_flag
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=461.00MB Threads=19
-Per-Host Resource Estimates: Memory=2.16GB
+Max Per-Host Resource Reservation: Memory=454.44MB Threads=19
+Per-Host Resource Estimates: Memory=2.15GB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=2.16GB mem-reservation=461.00MB thread-reservation=19 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=2.15GB mem-reservation=454.44MB thread-reservation=19 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -218,7 +218,7 @@ PLAN-ROOT SINK
| | hash predicates: customer_id = customer_id
| | fk/pk conjuncts: assumed fk/pk
| | runtime filters: RF008[bloom] <- customer_id, RF009[min_max] <- customer_id
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=26,68,12,40 row-size=225B cardinality=29.06K
| | in pipelines: 13(GETNEXT), 20(OPEN)
| |
@@ -231,7 +231,7 @@ PLAN-ROOT SINK
| | | output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
| | | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
| | | having: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
-| | | mem-estimate=52.01MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=50.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=35 row-size=169B cardinality=29.46K
| | | in pipelines: 20(GETNEXT), 15(OPEN)
| | |
@@ -290,7 +290,7 @@ PLAN-ROOT SINK
| | hash predicates: customer_id = customer_id
| | fk/pk conjuncts: assumed fk/pk
| | runtime filters: RF011[min_max] <- customer_id
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=26,68,12 row-size=181B cardinality=29.06K
| | in pipelines: 13(GETNEXT), 06(OPEN)
| |
@@ -303,7 +303,7 @@ PLAN-ROOT SINK
| | | output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
| | | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
| | | having: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) > CAST(0 AS DECIMAL(3,0))
-| | | mem-estimate=103.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=101.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=3 row-size=169B cardinality=58.90K
| | | in pipelines: 06(GETNEXT), 02(OPEN)
| | |
@@ -363,7 +363,7 @@ PLAN-ROOT SINK
| | hash predicates: customer_id = customer_id
| | fk/pk conjuncts: assumed fk/pk
| | runtime filters: RF012[bloom] <- customer_id, RF013[min_max] <- customer_id
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=26,68 row-size=137B cardinality=29.06K
| | in pipelines: 13(GETNEXT), 34(OPEN)
| |
@@ -439,7 +439,7 @@ PLAN-ROOT SINK
| 13:AGGREGATE [FINALIZE]
| | output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
| | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
-| | mem-estimate=103.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=101.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=17 row-size=169B cardinality=589.03K
| | in pipelines: 13(GETNEXT), 09(OPEN)
| |
@@ -503,7 +503,7 @@ PLAN-ROOT SINK
27:AGGREGATE [FINALIZE]
| output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
| group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
-| mem-estimate=52.01MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=50.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=49 row-size=169B cardinality=294.63K
| in pipelines: 27(GETNEXT), 22(OPEN)
|
@@ -558,7 +558,7 @@ PLAN-ROOT SINK
tuple-ids=46 row-size=153B cardinality=100.00K
in pipelines: 22(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=547.81MB Threads=50
+Max Per-Host Resource Reservation: Memory=546.88MB Threads=50
Per-Host Resource Estimates: Memory=2.60GB
F37:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
@@ -831,7 +831,7 @@ Per-Host Resources: mem-estimate=25.46MB mem-reservation=16.31MB thread-reservat
| | | in pipelines: 68(GETNEXT)
| | |
| | F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Host Resources: mem-estimate=45.17MB mem-reservation=34.00MB thread-reservation=1
+| | Per-Host Resources: mem-estimate=44.51MB mem-reservation=34.00MB thread-reservation=1
| | 00:UNION
| | | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | | tuple-ids=12 row-size=44B cardinality=58.90K
@@ -841,7 +841,7 @@ Per-Host Resources: mem-estimate=25.46MB mem-reservation=16.31MB thread-reservat
| | | output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
| | | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
| | | having: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) > CAST(0 AS DECIMAL(3,0))
-| | | mem-estimate=34.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=3 row-size=169B cardinality=58.90K
| | | in pipelines: 68(GETNEXT), 02(OPEN)
| | |
@@ -938,12 +938,12 @@ Per-Host Resources: mem-estimate=25.46MB mem-reservation=16.31MB thread-reservat
| | in pipelines: 57(GETNEXT)
| |
| F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=49.76MB mem-reservation=37.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=48.16MB mem-reservation=36.94MB thread-reservation=1 runtime-filters-memory=1.00MB
| 42:HASH JOIN [INNER JOIN, BROADCAST]
| | hash predicates: customer_id = customer_id
| | fk/pk conjuncts: assumed fk/pk
| | runtime filters: RF012[bloom] <- customer_id, RF013[min_max] <- customer_id
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=26,68 row-size=137B cardinality=29.06K
| | in pipelines: 57(GETNEXT), 62(OPEN)
| |
@@ -1061,7 +1061,7 @@ Per-Host Resources: mem-estimate=25.46MB mem-reservation=16.31MB thread-reservat
| 57:AGGREGATE [FINALIZE]
| | output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
| | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
-| | mem-estimate=34.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=17 row-size=169B cardinality=589.03K
| | in pipelines: 57(GETNEXT), 09(OPEN)
| |
@@ -1257,7 +1257,7 @@ Per-Host Resources: mem-estimate=291.95MB mem-reservation=19.94MB thread-reserva
tuple-ids=47 row-size=24B cardinality=1.44M
in pipelines: 23(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=646.31MB Threads=57
+Max Per-Host Resource Reservation: Memory=644.44MB Threads=57
Per-Host Resource Estimates: Memory=1.12GB
F37:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
@@ -1727,17 +1727,17 @@ Per-Instance Resources: mem-estimate=4.27MB mem-reservation=0B thread-reservatio
| | hash-table-id=10
| | hash predicates: customer_id = customer_id
| | fk/pk conjuncts: assumed fk/pk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=26,68 row-size=137B cardinality=29.06K
| | in pipelines: 57(GETNEXT), 62(OPEN)
| |
| |--F48:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=7.46MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=5.59MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=10 plan-id=11 cohort-id=03
| | | build expressions: customer_id
| | | runtime filters: RF012[bloom] <- customer_id, RF013[min_max] <- customer_id
-| | | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 63:EXCHANGE [BROADCAST]
| | | mem-estimate=731.94KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test
index 82440bf..64ca9d5 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test
@@ -142,7 +142,7 @@ PLAN-ROOT SINK
28:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) WHEN CAST(29 AS INT) THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) WHEN CAST(29 AS INT) THEN sum(`returns`) END), aggif(valid_tid(27,28 [...]
| group by: CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN channel WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN id WHEN CAST(28 AS INT) THEN NULL WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) WHEN CAST(29 AS INT) THEN CAST(29 AS INT) END
-| mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=30 row-size=76B cardinality=11.56K
| in pipelines: 28(GETNEXT), 27(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test
index 9fd3a28..e12c465 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test
@@ -25,10 +25,10 @@ select * from (
having count(*) >= 10
order by cnt limit 100) as t
---- PLAN
-Max Per-Host Resource Reservation: Memory=37.62MB Threads=8
-Per-Host Resource Estimates: Memory=303MB
+Max Per-Host Resource Reservation: Memory=32.94MB Threads=8
+Per-Host Resource Estimates: Memory=298MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=302.88MB mem-reservation=37.62MB thread-reservation=8 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=298.19MB mem-reservation=32.94MB thread-reservation=8 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: a.ca_state, count(*)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -103,7 +103,7 @@ PLAN-ROOT SINK
| hash predicates: s.ss_item_sk = i.i_item_sk
| fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
| runtime filters: RF004[bloom] <- i.i_item_sk, RF005[min_max] <- i.i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
| in pipelines: 02(GETNEXT), 04(OPEN)
|
@@ -159,7 +159,7 @@ PLAN-ROOT SINK
| hash predicates: s.ss_customer_sk = c.c_customer_sk
| fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
| runtime filters: RF010[bloom] <- c.c_customer_sk, RF011[min_max] <- c.c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=2,1 row-size=24B cardinality=2.88M
| in pipelines: 02(GETNEXT), 01(OPEN)
|
@@ -186,8 +186,8 @@ PLAN-ROOT SINK
tuple-ids=2 row-size=16B cardinality=2.88M
in pipelines: 02(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=52.94MB Threads=19
-Per-Host Resource Estimates: Memory=357MB
+Max Per-Host Resource Reservation: Memory=48.25MB Threads=19
+Per-Host Resource Estimates: Memory=352MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -223,7 +223,7 @@ Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservati
| in pipelines: 02(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=75.55MB mem-reservation=33.75MB thread-reservation=2 runtime-filters-memory=6.00MB
+Per-Host Resources: mem-estimate=70.86MB mem-reservation=29.06MB thread-reservation=2 runtime-filters-memory=6.00MB
15:AGGREGATE [STREAMING]
| output: count(*)
| group by: a.ca_state
@@ -336,7 +336,7 @@ Per-Host Resources: mem-estimate=75.55MB mem-reservation=33.75MB thread-reservat
| hash predicates: s.ss_item_sk = i.i_item_sk
| fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
| runtime filters: RF004[bloom] <- i.i_item_sk, RF005[min_max] <- i.i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
| in pipelines: 02(GETNEXT), 04(OPEN)
|
@@ -413,7 +413,7 @@ Per-Host Resources: mem-estimate=75.55MB mem-reservation=33.75MB thread-reservat
| hash predicates: s.ss_customer_sk = c.c_customer_sk
| fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
| runtime filters: RF010[bloom] <- c.c_customer_sk, RF011[min_max] <- c.c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=2,1 row-size=24B cardinality=2.88M
| in pipelines: 02(GETNEXT), 01(OPEN)
|
@@ -447,8 +447,8 @@ Per-Host Resources: mem-estimate=75.55MB mem-reservation=33.75MB thread-reservat
tuple-ids=2 row-size=16B cardinality=2.88M
in pipelines: 02(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=85.62MB Threads=20
-Per-Host Resource Estimates: Memory=276MB
+Max Per-Host Resource Reservation: Memory=76.25MB Threads=20
+Per-Host Resource Estimates: Memory=267MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -614,17 +614,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reser
| hash-table-id=02
| hash predicates: s.ss_item_sk = i.i_item_sk
| fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
| in pipelines: 02(GETNEXT), 04(OPEN)
|
|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.30MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.42MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=02 plan-id=03 cohort-id=01
| | build expressions: i.i_item_sk
| | runtime filters: RF004[bloom] <- i.i_item_sk, RF005[min_max] <- i.i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 20:EXCHANGE [BROADCAST]
| | mem-estimate=559.39KB mem-reservation=0B thread-reservation=0
@@ -717,17 +717,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reser
| hash-table-id=05
| hash predicates: s.ss_customer_sk = c.c_customer_sk
| fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| tuple-ids=2,1 row-size=24B cardinality=2.88M
| in pipelines: 02(GETNEXT), 01(OPEN)
|
|--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=18.77MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=11.27MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=05 plan-id=06 cohort-id=01
| | build expressions: c.c_customer_sk
| | runtime filters: RF010[bloom] <- c.c_customer_sk, RF011[min_max] <- c.c_customer_sk
-| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| |
| 17:EXCHANGE [BROADCAST]
| | mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test
index 1667c36..32254b5 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test
@@ -28,10 +28,10 @@ order by
i_item_id
limit 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=40.78MB Threads=6
-Per-Host Resource Estimates: Memory=316MB
+Max Per-Host Resource Reservation: Memory=31.34MB Threads=6
+Per-Host Resource Estimates: Memory=306MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=315.75MB mem-reservation=40.78MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=306.31MB mem-reservation=31.34MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: i_item_id, avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -53,7 +53,7 @@ PLAN-ROOT SINK
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -90,7 +90,7 @@ PLAN-ROOT SINK
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
| runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -140,8 +140,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=48.72MB Threads=12
-Per-Host Resource Estimates: Memory=346MB
+Max Per-Host Resource Reservation: Memory=39.28MB Threads=12
+Per-Host Resource Estimates: Memory=336MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -176,7 +176,7 @@ Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=155.29MB mem-reservation=33.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+Per-Host Resources: mem-estimate=145.85MB mem-reservation=24.31MB thread-reservation=2 runtime-filters-memory=4.00MB
09:AGGREGATE [STREAMING]
| output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
| group by: i_item_id
@@ -188,7 +188,7 @@ Per-Host Resources: mem-estimate=155.29MB mem-reservation=33.75MB thread-reserva
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -239,7 +239,7 @@ Per-Host Resources: mem-estimate=155.29MB mem-reservation=33.75MB thread-reserva
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
| runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -303,8 +303,8 @@ Per-Host Resources: mem-estimate=155.29MB mem-reservation=33.75MB thread-reserva
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=84.41MB Threads=13
-Per-Host Resource Estimates: Memory=202MB
+Max Per-Host Resource Reservation: Memory=65.53MB Threads=13
+Per-Host Resource Estimates: Memory=183MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -352,17 +352,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reser
| hash-table-id=00
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 14:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -419,17 +419,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reser
| hash-table-id=02
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=39.84MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=22.84MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=02 plan-id=03 cohort-id=01
| | build expressions: cd_demo_sk
| | runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
| |
| 12:EXCHANGE [BROADCAST]
| | mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test
index 574f6f5..7faaf0d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test
@@ -80,10 +80,10 @@ ORDER BY t_s_secyear.customer_id,
t_s_secyear.customer_preferred_cust_flag
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=346.25MB Threads=13
-Per-Host Resource Estimates: Memory=1.25GB
+Max Per-Host Resource Reservation: Memory=341.56MB Threads=13
+Per-Host Resource Estimates: Memory=1.20GB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=1.25GB mem-reservation=346.25MB thread-reservation=13 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=1.20GB mem-reservation=341.56MB thread-reservation=13 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -140,7 +140,7 @@ PLAN-ROOT SINK
| | hash predicates: c_customer_sk = ws_bill_customer_sk
| | fk/pk conjuncts: none
| | runtime filters: RF021[min_max] <- ws_bill_customer_sk
-| | mem-estimate=58.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=45.27MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=34,35 row-size=169B cardinality=719.38K
| | in pipelines: 22(GETNEXT), 23(OPEN)
| |
@@ -170,7 +170,7 @@ PLAN-ROOT SINK
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF002[bloom] <- customer_id, RF003[min_max] <- customer_id
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=18,28,8 row-size=181B cardinality=43.59K
| in pipelines: 13(GETNEXT), 06(OPEN)
|
@@ -183,7 +183,7 @@ PLAN-ROOT SINK
| | output: sum(ss_ext_list_price - ss_ext_discount_amt)
| | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
| | having: sum(ss_ext_list_price - ss_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
-| | mem-estimate=103.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=101.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=3 row-size=169B cardinality=58.90K
| | in pipelines: 06(GETNEXT), 01(OPEN)
| |
@@ -191,7 +191,7 @@ PLAN-ROOT SINK
| | hash predicates: c_customer_sk = ss_customer_sk
| | fk/pk conjuncts: c_customer_sk = ss_customer_sk
| | runtime filters: RF014[bloom] <- ss_customer_sk, RF015[min_max] <- ss_customer_sk
-| | mem-estimate=40.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=0,1,2 row-size=177B cardinality=589.03K
| | in pipelines: 01(GETNEXT), 02(OPEN)
| |
@@ -243,7 +243,7 @@ PLAN-ROOT SINK
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=137B cardinality=43.59K
| in pipelines: 13(GETNEXT), 20(OPEN)
|
@@ -285,7 +285,7 @@ PLAN-ROOT SINK
| | hash predicates: c_customer_sk = ws_bill_customer_sk
| | fk/pk conjuncts: none
| | runtime filters: RF012[bloom] <- ws_bill_customer_sk, RF013[min_max] <- ws_bill_customer_sk
-| | mem-estimate=58.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=45.27MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=24,25 row-size=169B cardinality=719.38K
| | in pipelines: 15(GETNEXT), 16(OPEN)
| |
@@ -319,7 +319,7 @@ PLAN-ROOT SINK
13:AGGREGATE [FINALIZE]
| output: sum(ss_ext_list_price - ss_ext_discount_amt)
| group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
-| mem-estimate=103.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=101.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=169B cardinality=589.03K
| in pipelines: 13(GETNEXT), 08(OPEN)
|
@@ -327,7 +327,7 @@ PLAN-ROOT SINK
| hash predicates: c_customer_sk = ss_customer_sk
| fk/pk conjuncts: c_customer_sk = ss_customer_sk
| runtime filters: RF006[bloom] <- ss_customer_sk, RF007[min_max] <- ss_customer_sk
-| mem-estimate=40.89MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=10,11,12 row-size=177B cardinality=589.03K
| in pipelines: 08(GETNEXT), 09(OPEN)
|
@@ -375,7 +375,7 @@ PLAN-ROOT SINK
tuple-ids=10 row-size=153B cardinality=100.00K
in pipelines: 08(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=352.25MB Threads=34
+Max Per-Host Resource Reservation: Memory=351.31MB Threads=34
Per-Host Resource Estimates: Memory=1.37GB
F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
@@ -525,7 +525,7 @@ Per-Host Resources: mem-estimate=16.11MB mem-reservation=9.62MB thread-reservati
| | in pipelines: 47(GETNEXT)
| |
| F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=45.17MB mem-reservation=34.00MB thread-reservation=1
+| Per-Host Resources: mem-estimate=44.51MB mem-reservation=34.00MB thread-reservation=1
| 00:UNION
| | mem-estimate=0B mem-reservation=0B thread-reservation=0
| | tuple-ids=8 row-size=44B cardinality=58.90K
@@ -535,7 +535,7 @@ Per-Host Resources: mem-estimate=16.11MB mem-reservation=9.62MB thread-reservati
| | output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
| | group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
| | having: sum(ss_ext_list_price - ss_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
-| | mem-estimate=34.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=3 row-size=169B cardinality=58.90K
| | in pipelines: 47(GETNEXT), 02(OPEN)
| |
@@ -632,12 +632,12 @@ Per-Host Resources: mem-estimate=16.11MB mem-reservation=9.62MB thread-reservati
| in pipelines: 36(GETNEXT)
|
F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=49.76MB mem-reservation=37.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=48.16MB mem-reservation=36.94MB thread-reservation=1 runtime-filters-memory=1.00MB
28:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=137B cardinality=43.59K
| in pipelines: 36(GETNEXT), 41(OPEN)
|
@@ -755,7 +755,7 @@ Per-Host Resources: mem-estimate=49.76MB mem-reservation=37.88MB thread-reservat
36:AGGREGATE [FINALIZE]
| output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
| group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
-| mem-estimate=34.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=169B cardinality=589.03K
| in pipelines: 36(GETNEXT), 09(OPEN)
|
@@ -846,8 +846,8 @@ Per-Host Resources: mem-estimate=51.95MB mem-reservation=5.94MB thread-reservati
tuple-ids=11 row-size=16B cardinality=2.88M
in pipelines: 09(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=444.88MB Threads=44
-Per-Host Resource Estimates: Memory=813MB
+Max Per-Host Resource Reservation: Memory=443.00MB Threads=44
+Per-Host Resource Estimates: Memory=811MB
F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.05MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1159,17 +1159,17 @@ Per-Instance Resources: mem-estimate=45.01MB mem-reservation=34.00MB thread-rese
| hash-table-id=06
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=137B cardinality=43.59K
| in pipelines: 36(GETNEXT), 41(OPEN)
|
|--F32:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.46MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.59MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=06 plan-id=07 cohort-id=01
| | build expressions: customer_id
| | runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 42:EXCHANGE [BROADCAST]
| | mem-estimate=731.94KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test
index bbe3c7b..9f2a9b0 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test
@@ -57,7 +57,7 @@ PLAN-ROOT SINK
05:AGGREGATE [FINALIZE]
| output: sum(ws_ext_sales_price)
| group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-| mem-estimate=44.07MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=43.24MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=198B cardinality=215.82K
| in pipelines: 05(GETNEXT), 00(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test
index 16e822e..9af2145 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test
@@ -118,7 +118,7 @@ PLAN-ROOT SINK
128:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(sales) WHEN CAST(105 AS INT) THEN sum(sales) WHEN CAST(106 AS INT) THEN sum(sales) WHEN CAST(107 AS INT) THEN sum(sales) WHEN CAST(108 AS INT) THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST [...]
| group by: CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN channel WHEN CAST(105 AS INT) THEN channel WHEN CAST(106 AS INT) THEN channel WHEN CAST(107 AS INT) THEN channel WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_brand_id WHEN CAST(105 AS INT) THEN i_brand_id WHEN CAST(106 AS INT) THEN i_brand_id WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(1 [...]
-| mem-estimate=36.47MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=109 row-size=52B cardinality=562.30K
| in pipelines: 128(GETNEXT), 127(OPEN)
|
@@ -138,7 +138,7 @@ PLAN-ROOT SINK
| Class 4
| output: sum(sales), sum(number_sales)
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=165.24MB mem-reservation=76.62MB thread-reservation=0
+| mem-estimate=163.12MB mem-reservation=76.62MB thread-reservation=0
| tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
| in pipelines: 127(GETNEXT), 30(OPEN), 72(OPEN), 114(OPEN)
|
@@ -262,7 +262,7 @@ PLAN-ROOT SINK
| 114:AGGREGATE [FINALIZE]
| | output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price), count(*)
| | group by: i_brand_id, i_class_id, i_category_id
-| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=88 row-size=36B cardinality=42.85K
| | in pipelines: 114(GETNEXT), 85(OPEN)
| |
@@ -644,7 +644,7 @@ PLAN-ROOT SINK
| 72:AGGREGATE [FINALIZE]
| | output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
| | group by: i_brand_id, i_class_id, i_category_id
-| | mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=54 row-size=36B cardinality=85.31K
| | in pipelines: 72(GETNEXT), 43(OPEN)
| |
@@ -1295,7 +1295,7 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=20B cardinality=2.88M
in pipelines: 01(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=430.00MB Threads=120
+Max Per-Host Resource Reservation: Memory=427.00MB Threads=120
Per-Host Resource Estimates: Memory=3.56GB
F80:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
@@ -1311,7 +1311,7 @@ PLAN-ROOT SINK
| in pipelines: 129(GETNEXT)
|
F79:PLAN FRAGMENT [HASH(CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(channel) WHEN 105 THEN murmur_hash(channel) WHEN 106 THEN murmur_hash(channel) WHEN 107 THEN murmur_hash(channel) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_brand_id) WHEN 105 THEN murmur_hash(i_brand_id) WHEN 106 THEN murmur_hash(i_brand_id) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WH [...]
-Per-Host Resources: mem-estimate=138.52MB mem-reservation=93.62MB thread-reservation=1
+Per-Host Resources: mem-estimate=137.09MB mem-reservation=93.62MB thread-reservation=1
129:TOP-N [LIMIT=100]
| order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(10 [...]
| mem-estimate=4.69KB mem-reservation=0B thread-reservation=0
@@ -1341,7 +1341,7 @@ Per-Host Resources: mem-estimate=138.52MB mem-reservation=93.62MB thread-reserva
| Class 4
| output: sum:merge(sales), sum:merge(number_sales)
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=121.52MB mem-reservation=76.62MB thread-reservation=0
+| mem-estimate=120.09MB mem-reservation=76.62MB thread-reservation=0
| tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
| in pipelines: 215(GETNEXT), 151(OPEN), 179(OPEN), 207(OPEN)
|
@@ -2116,11 +2116,11 @@ Per-Host Resources: mem-estimate=109.84MB mem-reservation=81.75MB thread-reserva
| | in pipelines: 43(GETNEXT)
| |
| F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=209.37MB mem-reservation=13.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=209.37MB mem-reservation=12.81MB thread-reservation=2 runtime-filters-memory=1.00MB
| 72:AGGREGATE [STREAMING]
| | output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
| | group by: i_brand_id, i_class_id, i_category_id
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=54 row-size=36B cardinality=85.31K
| | in pipelines: 43(GETNEXT)
| |
@@ -2689,11 +2689,11 @@ Per-Host Resources: mem-estimate=109.84MB mem-reservation=81.75MB thread-reserva
| in pipelines: 01(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=67.37MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=67.37MB mem-reservation=12.81MB thread-reservation=2 runtime-filters-memory=3.00MB
30:AGGREGATE [STREAMING]
| output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
| group by: i_brand_id, i_class_id, i_category_id
-| mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=20 row-size=36B cardinality=148.80K
| in pipelines: 01(GETNEXT)
|
@@ -3098,7 +3098,7 @@ Per-Host Resources: mem-estimate=67.37MB mem-reservation=14.81MB thread-reservat
tuple-ids=0 row-size=20B cardinality=2.88M
in pipelines: 01(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=665.12MB Threads=141
+Max Per-Host Resource Reservation: Memory=662.12MB Threads=141
Per-Host Resource Estimates: Memory=2.26GB
F80:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
@@ -4079,11 +4079,11 @@ Per-Instance Resources: mem-estimate=75.94MB mem-reservation=45.88MB thread-rese
| |
| F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
| Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
-| Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=58.00MB mem-reservation=6.00MB thread-reservation=1
| 72:AGGREGATE [STREAMING]
| | output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
| | group by: i_brand_id, i_class_id, i_category_id
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=54 row-size=36B cardinality=85.31K
| | in pipelines: 43(GETNEXT)
| |
@@ -4780,11 +4780,11 @@ Per-Instance Resources: mem-estimate=75.94MB mem-reservation=45.88MB thread-rese
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
-Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
30:AGGREGATE [STREAMING]
| output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
| group by: i_brand_id, i_class_id, i_category_id
-| mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=20 row-size=36B cardinality=148.80K
| in pipelines: 01(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test
index 6ceb4d3..81c2d03 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test
@@ -27,10 +27,10 @@ GROUP BY ca_zip
ORDER BY ca_zip
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=24.19MB Threads=5
-Per-Host Resource Estimates: Memory=290MB
+Max Per-Host Resource Reservation: Memory=20.44MB Threads=5
+Per-Host Resource Estimates: Memory=286MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=290.19MB mem-reservation=24.19MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=286.44MB mem-reservation=20.44MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: ca_zip, sum(cs_sales_price)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -71,7 +71,7 @@ PLAN-ROOT SINK
| hash predicates: cs_bill_customer_sk = c_customer_sk
| fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=32B cardinality=146.92K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
index 637e5d6..c1a68e4 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
@@ -24,10 +24,10 @@ WHERE d_date BETWEEN '2002-02-01' AND cast('2002-04-02' AS date)
ORDER BY count(DISTINCT cs_order_number)
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=48.81MB Threads=7
+Max Per-Host Resource Reservation: Memory=45.06MB Threads=7
Per-Host Resource Estimates: Memory=570MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=570.31MB mem-reservation=48.81MB thread-reservation=7 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=570.31MB mem-reservation=45.06MB thread-reservation=7 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: count(cs_order_number), sum(cs_ext_ship_cost), sum(cs_net_profit)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -71,7 +71,7 @@ PLAN-ROOT SINK
| hash predicates: cs2.cs_order_number = cs1.cs_order_number
| other join predicates: cs1.cs_warehouse_sk != cs2.cs_warehouse_sk
| runtime filters: RF000[bloom] <- cs1.cs_order_number, RF001[min_max] <- cs1.cs_order_number
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,2,1,3 row-size=109B cardinality=29.10K
| in pipelines: 04(GETNEXT), 00(OPEN)
|
@@ -160,8 +160,8 @@ PLAN-ROOT SINK
tuple-ids=4 row-size=12B cardinality=1.44M
in pipelines: 04(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=47.64MB Threads=14
-Per-Host Resource Estimates: Memory=590MB
+Max Per-Host Resource Reservation: Memory=45.77MB Threads=14
+Per-Host Resource Estimates: Memory=588MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -186,7 +186,7 @@ PLAN-ROOT SINK
| in pipelines: 12(GETNEXT)
|
F05:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=24.17MB mem-reservation=10.56MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=22.30MB mem-reservation=8.69MB thread-reservation=1 runtime-filters-memory=1.00MB
12:AGGREGATE
| output: count(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
| mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
@@ -202,7 +202,7 @@ Per-Host Resources: mem-estimate=24.17MB mem-reservation=10.56MB thread-reservat
|
10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
| hash predicates: cs1.cs_order_number = cr1.cr_order_number
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,2,1,3 row-size=109B cardinality=29.10K
| in pipelines: 04(GETNEXT), 05(OPEN)
|
@@ -351,8 +351,8 @@ Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservati
tuple-ids=4 row-size=12B cardinality=1.44M
in pipelines: 04(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=56.45MB Threads=13
-Per-Host Resource Estimates: Memory=218MB
+Max Per-Host Resource Reservation: Memory=54.58MB Threads=13
+Per-Host Resource Estimates: Memory=216MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -394,16 +394,16 @@ Per-Instance Resources: mem-estimate=15.55MB mem-reservation=1.94MB thread-reser
10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
| hash-table-id=00
| hash predicates: cs1.cs_order_number = cr1.cr_order_number
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,2,1,3 row-size=109B cardinality=29.10K
| in pipelines: 04(GETNEXT), 05(OPEN)
|
|--F08:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.75MB thread-reservation=1
+| | Per-Instance Resources: mem-estimate=3.99MB mem-reservation=2.88MB thread-reservation=1
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: cr1.cr_order_number
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| |
| 19:EXCHANGE [HASH(cr1.cr_order_number)]
| | mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test
index 46f3e91..336f833 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test
@@ -218,7 +218,7 @@ PLAN-ROOT SINK
tuple-ids=7 row-size=148B cardinality=18.00K
in pipelines: 07(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=71.45MB Threads=20
+Max Per-Host Resource Reservation: Memory=70.52MB Threads=20
Per-Host Resource Estimates: Memory=648MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
@@ -254,7 +254,7 @@ Per-Host Resources: mem-estimate=10.82MB mem-reservation=1.94MB thread-reservati
| in pipelines: 02(GETNEXT)
|
F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=17.24MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=16.30MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
15:AGGREGATE [STREAMING]
| output: count(ss_quantity), avg(CAST(ss_quantity AS BIGINT)), stddev_samp(ss_quantity), count(sr_return_quantity), avg(CAST(sr_return_quantity AS BIGINT)), stddev_samp(sr_return_quantity), count(cs_quantity), avg(CAST(cs_quantity AS BIGINT)), stddev_samp(cs_quantity)
| group by: i_item_id, i_item_desc, s_state
@@ -266,7 +266,7 @@ Per-Host Resources: mem-estimate=17.24MB mem-reservation=5.88MB thread-reservati
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=312B cardinality=2.02K
| in pipelines: 02(GETNEXT), 07(OPEN)
|
@@ -474,8 +474,8 @@ Per-Host Resources: mem-estimate=205.57MB mem-reservation=19.75MB thread-reserva
tuple-ids=2 row-size=20B cardinality=1.44M
in pipelines: 02(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=94.08MB Threads=22
-Per-Host Resource Estimates: Memory=294MB
+Max Per-Host Resource Reservation: Memory=93.14MB Threads=22
+Per-Host Resource Estimates: Memory=293MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -522,17 +522,17 @@ Per-Instance Resources: mem-estimate=10.67MB mem-reservation=2.00MB thread-reser
| hash-table-id=00
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=312B cardinality=2.02K
| in pipelines: 02(GETNEXT), 07(OPEN)
|
|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=6.57MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| |
| 25:EXCHANGE [HASH(i_item_sk)]
| | mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test
index 9c4c09a..61a65d1 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test
@@ -32,9 +32,9 @@ select i_item_id,
limit 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=109.94MB Threads=8
-Per-Host Resource Estimates: Memory=690MB
+Per-Host Resource Estimates: Memory=689MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=689.50MB mem-reservation=109.94MB thread-reservation=8 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=688.56MB mem-reservation=109.94MB thread-reservation=8 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -76,7 +76,7 @@ PLAN-ROOT SINK
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,1,0,5,3,4,6 row-size=220B cardinality=28.95K
| in pipelines: 02(GETNEXT), 06(OPEN)
|
@@ -206,8 +206,8 @@ PLAN-ROOT SINK
tuple-ids=2 row-size=4B cardinality=1.92M
in pipelines: 02(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=195.19MB Threads=18
-Per-Host Resource Estimates: Memory=887MB
+Max Per-Host Resource Reservation: Memory=194.25MB Threads=18
+Per-Host Resource Estimates: Memory=886MB
F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -262,7 +262,7 @@ Per-Host Resources: mem-estimate=75.94MB mem-reservation=57.69MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F07:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=99.10MB mem-reservation=76.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=98.17MB mem-reservation=75.94MB thread-reservation=1 runtime-filters-memory=2.00MB
13:AGGREGATE [STREAMING]
| Class 0
| output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
@@ -287,7 +287,7 @@ Per-Host Resources: mem-estimate=99.10MB mem-reservation=76.88MB thread-reservat
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,5,3,4,1,2,6 row-size=220B cardinality=28.95K
| in pipelines: 00(GETNEXT), 06(OPEN)
|
@@ -471,8 +471,8 @@ Per-Host Resources: mem-estimate=399.14MB mem-reservation=29.62MB thread-reserva
tuple-ids=0 row-size=40B cardinality=1.44M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=208.69MB Threads=17
-Per-Host Resource Estimates: Memory=373MB
+Max Per-Host Resource Reservation: Memory=206.81MB Threads=17
+Per-Host Resource Estimates: Memory=371MB
F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -552,17 +552,17 @@ Per-Instance Resources: mem-estimate=52.24MB mem-reservation=38.00MB thread-rese
| hash-table-id=00
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,5,3,4,1,2,6 row-size=220B cardinality=28.95K
| in pipelines: 00(GETNEXT), 06(OPEN)
|
|--F11:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 23:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test
index 8039982..6015548 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test
@@ -167,8 +167,8 @@ PLAN-ROOT SINK
tuple-ids=4 row-size=21B cardinality=50.00K
in pipelines: 04(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=32.02MB Threads=16
-Per-Host Resource Estimates: Memory=351MB
+Max Per-Host Resource Reservation: Memory=31.08MB Threads=16
+Per-Host Resource Estimates: Memory=350MB
F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -203,7 +203,7 @@ Per-Host Resources: mem-estimate=10.27MB mem-reservation=1.94MB thread-reservati
| in pipelines: 01(GETNEXT)
|
F06:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=18.30MB mem-reservation=8.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=17.36MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
11:AGGREGATE [STREAMING]
| output: sum(ss_ext_sales_price)
| group by: i_brand, i_brand_id, i_manufact_id, i_manufact
@@ -241,7 +241,7 @@ Per-Host Resources: mem-estimate=18.30MB mem-reservation=8.81MB thread-reservati
| hash predicates: c_current_addr_sk = ca_address_sk
| fk/pk conjuncts: c_current_addr_sk = ca_address_sk
| runtime filters: RF002[bloom] <- ca_address_sk, RF003[min_max] <- ca_address_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=1,2,0,3,4 row-size=137B cardinality=1.72K
| in pipelines: 01(GETNEXT), 04(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test
index 54cb4eb..703e996 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test
@@ -59,7 +59,7 @@ PLAN-ROOT SINK
05:AGGREGATE [FINALIZE]
| output: sum(cs_ext_sales_price)
| group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-| mem-estimate=88.30MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=86.65MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=198B cardinality=432.46K
| in pipelines: 05(GETNEXT), 00(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test
index 16cce38..966b450 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test
@@ -20,9 +20,9 @@ order by qoh, i_product_name, i_brand, i_class, i_category
limit 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=149.44MB Threads=5
-Per-Host Resource Estimates: Memory=16.90GB
+Per-Host Resource Estimates: Memory=16.63GB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=16.90GB mem-reservation=149.44MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=16.63GB mem-reservation=149.44MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 TH [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -36,7 +36,7 @@ PLAN-ROOT SINK
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(5,7,9,11,13) IN (CAST(5 AS INT), CAST(7 AS INT), CAST(9 AS INT), CAST(11 AS INT), CAST(13 AS INT)), CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(7 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(9 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(11 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(13 AS INT) THEN avg(inv_quantity_on_hand) END)
| group by: CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN i_product_name WHEN CAST(11 AS INT) THEN i_product_name WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_class [...]
-| mem-estimate=2.50GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=2.36GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=14 row-size=60B cardinality=35.25M
| in pipelines: 08(GETNEXT), 07(OPEN)
|
@@ -56,7 +56,7 @@ PLAN-ROOT SINK
| Class 4
| output: avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=14.40GB mem-reservation=112.44MB thread-reservation=0
+| mem-estimate=14.27GB mem-reservation=112.44MB thread-reservation=0
| tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -129,7 +129,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=292.57MB Threads=10
-Per-Host Resource Estimates: Memory=26.41GB
+Per-Host Resource Estimates: Memory=26.12GB
F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -144,7 +144,7 @@ PLAN-ROOT SINK
| in pipelines: 09(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 10 THEN murmur_hash(i_product_name) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash [...]
-Per-Host Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-reservation=1
+Per-Host Resources: mem-estimate=20.49GB mem-reservation=146.44MB thread-reservation=1
09:TOP-N [LIMIT=100]
| order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 [...]
| mem-estimate=5.47KB mem-reservation=0B thread-reservation=0
@@ -154,7 +154,7 @@ Per-Host Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-reserva
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(5,7,9,11,13) IN (CAST(5 AS INT), CAST(7 AS INT), CAST(9 AS INT), CAST(11 AS INT), CAST(13 AS INT)), CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(7 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(9 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(11 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(13 AS INT) THEN avg(inv_quantity_on_hand) END)
| group by: CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN i_product_name WHEN CAST(11 AS INT) THEN i_product_name WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_class [...]
-| mem-estimate=1.25GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=1.18GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=14 row-size=60B cardinality=35.25M
| in pipelines: 08(GETNEXT), 14(OPEN)
|
@@ -174,7 +174,7 @@ Per-Host Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-reserva
| Class 4
| output: avg:merge(inv_quantity_on_hand)
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=19.48GB mem-reservation=112.44MB thread-reservation=0
+| mem-estimate=19.30GB mem-reservation=112.44MB thread-reservation=0
| tuple-ids=5N,7N,9N,11N,13N row-size=422B cardinality=35.25M
| in pipelines: 14(GETNEXT), 00(OPEN)
|
@@ -184,7 +184,7 @@ Per-Host Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=5.55GB mem-reservation=140.62MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=5.50GB mem-reservation=140.62MB thread-reservation=2 runtime-filters-memory=3.00MB
07:AGGREGATE [STREAMING]
| Class 0
| output: avg(CAST(inv_quantity_on_hand AS BIGINT))
@@ -201,7 +201,7 @@ Per-Host Resources: mem-estimate=5.55GB mem-reservation=140.62MB thread-reservat
| Class 4
| output: avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=5.41GB mem-reservation=113.00MB thread-reservation=0
+| mem-estimate=5.36GB mem-reservation=113.00MB thread-reservation=0
| tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
| in pipelines: 00(GETNEXT)
|
@@ -295,7 +295,7 @@ Per-Host Resources: mem-estimate=5.55GB mem-reservation=140.62MB thread-reservat
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=304.20MB Threads=9
-Per-Host Resource Estimates: Memory=26.25GB
+Per-Host Resource Estimates: Memory=25.96GB
F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -310,7 +310,7 @@ PLAN-ROOT SINK
| in pipelines: 09(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 10 THEN murmur_hash(i_product_name) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash [...]
-Per-Instance Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-reservation=1
+Per-Instance Resources: mem-estimate=20.49GB mem-reservation=146.44MB thread-reservation=1
09:TOP-N [LIMIT=100]
| order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 [...]
| mem-estimate=5.47KB mem-reservation=0B thread-reservation=0
@@ -320,7 +320,7 @@ Per-Instance Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-res
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(5,7,9,11,13) IN (CAST(5 AS INT), CAST(7 AS INT), CAST(9 AS INT), CAST(11 AS INT), CAST(13 AS INT)), CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(7 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(9 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(11 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(13 AS INT) THEN avg(inv_quantity_on_hand) END)
| group by: CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN i_product_name WHEN CAST(11 AS INT) THEN i_product_name WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_class [...]
-| mem-estimate=1.25GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=1.18GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=14 row-size=60B cardinality=35.25M
| in pipelines: 08(GETNEXT), 14(OPEN)
|
@@ -340,7 +340,7 @@ Per-Instance Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-res
| Class 4
| output: avg:merge(inv_quantity_on_hand)
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=19.48GB mem-reservation=112.44MB thread-reservation=0
+| mem-estimate=19.30GB mem-reservation=112.44MB thread-reservation=0
| tuple-ids=5N,7N,9N,11N,13N row-size=422B cardinality=35.25M
| in pipelines: 14(GETNEXT), 00(OPEN)
|
@@ -351,7 +351,7 @@ Per-Instance Resources: mem-estimate=20.73GB mem-reservation=146.44MB thread-res
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
-Per-Instance Resources: mem-estimate=5.44GB mem-reservation=129.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=5.39GB mem-reservation=129.00MB thread-reservation=1
07:AGGREGATE [STREAMING]
| Class 0
| output: avg(CAST(inv_quantity_on_hand AS BIGINT))
@@ -368,7 +368,7 @@ Per-Instance Resources: mem-estimate=5.44GB mem-reservation=129.00MB thread-rese
| Class 4
| output: avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: NULL, NULL, NULL, NULL
-| mem-estimate=5.41GB mem-reservation=113.00MB thread-reservation=0
+| mem-estimate=5.36GB mem-reservation=113.00MB thread-reservation=0
| tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
index 43d8731..984257d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
@@ -49,10 +49,10 @@ from
and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)) y
limit 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=92.06MB Threads=11
-Per-Host Resource Estimates: Memory=650MB
+Max Per-Host Resource Reservation: Memory=84.56MB Threads=11
+Per-Host Resource Estimates: Memory=633MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=649.78MB mem-reservation=92.06MB thread-reservation=11 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=633.30MB mem-reservation=84.56MB thread-reservation=11 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: sum(sales)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -93,7 +93,7 @@ PLAN-ROOT SINK
| | | | output: count(*)
| | | | group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
| | | | having: count(*) > CAST(4 AS BIGINT)
-| | | | mem-estimate=148.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | | mem-estimate=139.22MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | | tuple-ids=27 row-size=50B cardinality=235.45K
| | | | in pipelines: 32(GETNEXT), 27(OPEN)
| | | |
@@ -203,7 +203,7 @@ PLAN-ROOT SINK
| | | hash predicates: ss_customer_sk = c_customer_sk
| | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | runtime filters: RF021[min_max] <- c_customer_sk
-| | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=34,36,35 row-size=28B cardinality=2.35M
| | | in pipelines: 37(GETNEXT), 38(OPEN)
| | |
@@ -261,7 +261,7 @@ PLAN-ROOT SINK
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF019[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | in pipelines: 33(GETNEXT), 34(OPEN)
| |
@@ -312,7 +312,7 @@ PLAN-ROOT SINK
| | | output: count(*)
| | | group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
| | | having: count(*) > CAST(4 AS BIGINT)
-| | | mem-estimate=148.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=139.22MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=5 row-size=50B cardinality=235.45K
| | | in pipelines: 08(GETNEXT), 03(OPEN)
| | |
@@ -422,7 +422,7 @@ PLAN-ROOT SINK
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=12,14,13 row-size=28B cardinality=2.35M
| | in pipelines: 13(GETNEXT), 14(OPEN)
| |
@@ -480,7 +480,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=8,9 row-size=16B cardinality=2.88M
| in pipelines: 09(GETNEXT), 10(OPEN)
|
@@ -507,8 +507,8 @@ PLAN-ROOT SINK
tuple-ids=8 row-size=12B cardinality=2.88M
in pipelines: 09(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=285.38MB Threads=50
-Per-Host Resource Estimates: Memory=1.37GB
+Max Per-Host Resource Reservation: Memory=270.38MB Threads=50
+Per-Host Resource Estimates: Memory=1.34GB
F31:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -580,7 +580,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | | in pipelines: 83(GETNEXT)
| | | |
| | | F28:PLAN FRAGMENT [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)] hosts=3 instances=3
-| | | Per-Host Resources: mem-estimate=69.56MB mem-reservation=36.00MB thread-reservation=1
+| | | Per-Host Resources: mem-estimate=66.56MB mem-reservation=36.00MB thread-reservation=1
| | | 46:AGGREGATE [STREAMING]
| | | | group by: i_item_sk
| | | | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
@@ -591,7 +591,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | | output: count:merge(*)
| | | | group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
| | | | having: count(*) > CAST(4 AS BIGINT)
-| | | | mem-estimate=49.40MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | | mem-estimate=46.41MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | | tuple-ids=27 row-size=50B cardinality=235.45K
| | | | in pipelines: 83(GETNEXT), 27(OPEN)
| | | |
@@ -601,11 +601,11 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | | in pipelines: 27(GETNEXT)
| | | |
| | | F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Host Resources: mem-estimate=63.00MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+| | | Per-Host Resources: mem-estimate=60.76MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
| | | 32:AGGREGATE [STREAMING]
| | | | output: count(*)
| | | | group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
-| | | | mem-estimate=37.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | | mem-estimate=34.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | | tuple-ids=27 row-size=50B cardinality=2.35M
| | | | in pipelines: 27(GETNEXT)
| | | |
@@ -758,7 +758,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | in pipelines: 37(GETNEXT)
| | |
| | F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Host Resources: mem-estimate=69.85MB mem-reservation=17.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+| | Per-Host Resources: mem-estimate=66.10MB mem-reservation=13.69MB thread-reservation=2 runtime-filters-memory=1.00MB
| | 42:AGGREGATE [STREAMING]
| | | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| | | group by: c_customer_sk
@@ -770,7 +770,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | hash predicates: ss_customer_sk = c_customer_sk
| | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | runtime filters: RF021[min_max] <- c_customer_sk
-| | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=34,36,35 row-size=28B cardinality=2.35M
| | | in pipelines: 37(GETNEXT), 38(OPEN)
| | |
@@ -844,7 +844,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | in pipelines: 33(GETNEXT)
| |
| F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=67.89MB mem-reservation=15.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=64.14MB mem-reservation=11.75MB thread-reservation=2 runtime-filters-memory=1.00MB
| 36:AGGREGATE [STREAMING]
| | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| | group by: c_customer_sk
@@ -856,7 +856,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF019[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | in pipelines: 33(GETNEXT), 34(OPEN)
| |
@@ -930,7 +930,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | in pipelines: 64(GETNEXT)
| | |
| | F13:PLAN FRAGMENT [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)] hosts=3 instances=3
-| | Per-Host Resources: mem-estimate=69.56MB mem-reservation=36.00MB thread-reservation=1
+| | Per-Host Resources: mem-estimate=66.56MB mem-reservation=36.00MB thread-reservation=1
| | 22:AGGREGATE [STREAMING]
| | | group by: i_item_sk
| | | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
@@ -941,7 +941,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | output: count:merge(*)
| | | group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
| | | having: count(*) > CAST(4 AS BIGINT)
-| | | mem-estimate=49.40MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=46.41MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=5 row-size=50B cardinality=235.45K
| | | in pipelines: 64(GETNEXT), 03(OPEN)
| | |
@@ -951,11 +951,11 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | | in pipelines: 03(GETNEXT)
| | |
| | F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Host Resources: mem-estimate=63.00MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+| | Per-Host Resources: mem-estimate=60.76MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
| | 08:AGGREGATE [STREAMING]
| | | output: count(*)
| | | group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
-| | | mem-estimate=37.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=34.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=5 row-size=50B cardinality=2.35M
| | | in pipelines: 03(GETNEXT)
| | |
@@ -1108,7 +1108,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | in pipelines: 13(GETNEXT)
| |
| F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=70.85MB mem-reservation=18.44MB thread-reservation=2 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=67.10MB mem-reservation=14.69MB thread-reservation=2 runtime-filters-memory=2.00MB
| 18:AGGREGATE [STREAMING]
| | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| | group by: c_customer_sk
@@ -1120,7 +1120,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=12,14,13 row-size=28B cardinality=2.35M
| | in pipelines: 13(GETNEXT), 14(OPEN)
| |
@@ -1194,7 +1194,7 @@ Per-Host Resources: mem-estimate=16.72MB mem-reservation=7.75MB thread-reservati
| in pipelines: 09(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=68.89MB mem-reservation=16.50MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=65.14MB mem-reservation=12.75MB thread-reservation=2 runtime-filters-memory=2.00MB
12:AGGREGATE [STREAMING]
| output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| group by: c_customer_sk
@@ -1206,7 +1206,7 @@ Per-Host Resources: mem-estimate=68.89MB mem-reservation=16.50MB thread-reservat
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=8,9 row-size=16B cardinality=2.88M
| in pipelines: 09(GETNEXT), 10(OPEN)
|
@@ -1240,8 +1240,8 @@ Per-Host Resources: mem-estimate=68.89MB mem-reservation=16.50MB thread-reservat
tuple-ids=8 row-size=12B cardinality=2.88M
in pipelines: 09(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=531.12MB Threads=63
-Per-Host Resource Estimates: Memory=1.14GB
+Max Per-Host Resource Reservation: Memory=501.12MB Threads=63
+Per-Host Resource Estimates: Memory=1.11GB
F31:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1553,17 +1553,17 @@ Per-Instance Resources: mem-estimate=10.79MB mem-reservation=1.94MB thread-reser
| | | hash-table-id=14
| | | hash predicates: ss_customer_sk = c_customer_sk
| | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=34,36,35 row-size=28B cardinality=2.35M
| | | in pipelines: 37(GETNEXT), 38(OPEN)
| | |
| | |--F46:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | | JOIN BUILD
| | | | join-table-id=14 plan-id=15 cohort-id=07
| | | | build expressions: c_customer_sk
| | | | runtime filters: RF021[min_max] <- c_customer_sk
-| | | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | | |
| | | 73:EXCHANGE [BROADCAST]
| | | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -1656,17 +1656,17 @@ Per-Instance Resources: mem-estimate=10.79MB mem-reservation=1.94MB thread-reser
| | hash-table-id=17
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | in pipelines: 33(GETNEXT), 34(OPEN)
| |
| |--F49:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=17 plan-id=18 cohort-id=01
| | | build expressions: c_customer_sk
| | | runtime filters: RF019[min_max] <- c_customer_sk
-| | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | |
| | 69:EXCHANGE [BROADCAST]
| | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -1979,17 +1979,17 @@ Per-Instance Resources: mem-estimate=10.79MB mem-reservation=1.94MB thread-reser
| | hash-table-id=06
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=12,14,13 row-size=28B cardinality=2.35M
| | in pipelines: 13(GETNEXT), 14(OPEN)
| |
| |--F38:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=18.39MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=10.89MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=06 plan-id=07 cohort-id=04
| | | build expressions: c_customer_sk
| | | runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | |
| | 54:EXCHANGE [BROADCAST]
| | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -2082,17 +2082,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reser
| hash-table-id=16
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| tuple-ids=8,9 row-size=16B cardinality=2.88M
| in pipelines: 09(GETNEXT), 10(OPEN)
|
|--F48:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=18.39MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=10.89MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=16 plan-id=17 cohort-id=01
| | build expressions: c_customer_sk
| | runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| |
| 50:EXCHANGE [BROADCAST]
| | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test
index c928198..cd9e784 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test
@@ -84,10 +84,10 @@ ORDER BY c_last_name,
sales
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=88.81MB Threads=12
-Per-Host Resource Estimates: Memory=698MB
+Max Per-Host Resource Reservation: Memory=81.31MB Threads=12
+Per-Host Resource Estimates: Memory=681MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=697.77MB mem-reservation=88.81MB thread-reservation=12 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=681.29MB mem-reservation=81.31MB thread-reservation=12 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: c_last_name, c_first_name, sales
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -165,7 +165,7 @@ PLAN-ROOT SINK
| | | | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | | | runtime filters: RF033[min_max] <- c_customer_sk
-| | | | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | | | tuple-ids=32,34,33 row-size=28B cardinality=2.35M
| | | | | | in pipelines: 38(GETNEXT), 39(OPEN)
| | | | | |
@@ -215,7 +215,7 @@ PLAN-ROOT SINK
| | | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | | runtime filters: RF031[min_max] <- c_customer_sk
-| | | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | | | | in pipelines: 36(GETNEXT), 37(OPEN)
| | | | |
@@ -288,7 +288,7 @@ PLAN-ROOT SINK
| | output: count(*)
| | group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
| | having: count(*) > CAST(4 AS BIGINT)
-| | mem-estimate=148.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=139.22MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=28 row-size=50B cardinality=235.45K
| | in pipelines: 35(GETNEXT), 30(OPEN)
| |
@@ -404,7 +404,7 @@ PLAN-ROOT SINK
| | | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | | runtime filters: RF015[min_max] <- c_customer_sk
-| | | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | | tuple-ids=11,13,12 row-size=28B cardinality=2.35M
| | | | | in pipelines: 12(GETNEXT), 13(OPEN)
| | | | |
@@ -455,7 +455,7 @@ PLAN-ROOT SINK
| | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | runtime filters: RF013[min_max] <- c_customer_sk
-| | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | tuple-ids=9,10 row-size=16B cardinality=2.88M
| | | | in pipelines: 10(GETNEXT), 11(OPEN)
| | | |
@@ -528,7 +528,7 @@ PLAN-ROOT SINK
| output: count(*)
| group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
| having: count(*) > CAST(4 AS BIGINT)
-| mem-estimate=148.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=139.22MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=50B cardinality=235.45K
| in pipelines: 09(GETNEXT), 04(OPEN)
|
@@ -584,8 +584,8 @@ PLAN-ROOT SINK
tuple-ids=3 row-size=12B cardinality=2.88M
in pipelines: 04(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=308.69MB Threads=56
-Per-Host Resource Estimates: Memory=1.49GB
+Max Per-Host Resource Reservation: Memory=293.69MB Threads=56
+Per-Host Resource Estimates: Memory=1.46GB
F35:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -626,7 +626,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | in pipelines: 78(GETNEXT)
| |
| F20:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=74.71MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=71.72MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| 52:AGGREGATE [STREAMING]
| | output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price)
| | group by: c_last_name, c_first_name
@@ -710,7 +710,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | | | in pipelines: 36(GETNEXT)
| | | |
| | | F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Host Resources: mem-estimate=66.90MB mem-reservation=18.50MB thread-reservation=2
+| | | Per-Host Resources: mem-estimate=63.15MB mem-reservation=14.75MB thread-reservation=2
| | | 47:AGGREGATE [STREAMING]
| | | | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
| | | | group by: c_customer_sk
@@ -762,7 +762,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | | | | in pipelines: 38(GETNEXT)
| | | | |
| | | | F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | Per-Host Resources: mem-estimate=69.85MB mem-reservation=17.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+| | | | Per-Host Resources: mem-estimate=66.10MB mem-reservation=13.69MB thread-reservation=2 runtime-filters-memory=1.00MB
| | | | 43:AGGREGATE [STREAMING]
| | | | | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| | | | | group by: c_customer_sk
@@ -774,7 +774,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | | runtime filters: RF033[min_max] <- c_customer_sk
-| | | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | | tuple-ids=32,34,33 row-size=28B cardinality=2.35M
| | | | | in pipelines: 38(GETNEXT), 39(OPEN)
| | | | |
@@ -839,7 +839,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | runtime filters: RF031[min_max] <- c_customer_sk
-| | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | | | in pipelines: 36(GETNEXT), 37(OPEN)
| | | |
@@ -916,7 +916,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | output: count:merge(*)
| | group by: itemdesc, i_item_sk, d_date
| | having: count(*) > CAST(4 AS BIGINT)
-| | mem-estimate=49.40MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=46.41MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=28 row-size=50B cardinality=235.45K
| | in pipelines: 78(GETNEXT), 30(OPEN)
| |
@@ -926,11 +926,11 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| | in pipelines: 30(GETNEXT)
| |
| F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=64.00MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=61.76MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
| 35:AGGREGATE [STREAMING]
| | output: count(*)
| | group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
-| | mem-estimate=37.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=28 row-size=50B cardinality=2.35M
| | in pipelines: 30(GETNEXT)
| |
@@ -1013,7 +1013,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| in pipelines: 57(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=71.94MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
26:AGGREGATE [STREAMING]
| output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price)
| group by: c_last_name, c_first_name
@@ -1097,7 +1097,7 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| | | in pipelines: 10(GETNEXT)
| | |
| | F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Host Resources: mem-estimate=66.90MB mem-reservation=18.50MB thread-reservation=2
+| | Per-Host Resources: mem-estimate=63.15MB mem-reservation=14.75MB thread-reservation=2
| | 21:AGGREGATE [STREAMING]
| | | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
| | | group by: c_customer_sk
@@ -1149,7 +1149,7 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| | | | in pipelines: 12(GETNEXT)
| | | |
| | | F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Host Resources: mem-estimate=69.85MB mem-reservation=17.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+| | | Per-Host Resources: mem-estimate=66.10MB mem-reservation=13.69MB thread-reservation=2 runtime-filters-memory=1.00MB
| | | 17:AGGREGATE [STREAMING]
| | | | output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
| | | | group by: c_customer_sk
@@ -1161,7 +1161,7 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | | runtime filters: RF015[min_max] <- c_customer_sk
-| | | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | | tuple-ids=11,13,12 row-size=28B cardinality=2.35M
| | | | in pipelines: 12(GETNEXT), 13(OPEN)
| | | |
@@ -1226,7 +1226,7 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| | | hash predicates: ss_customer_sk = c_customer_sk
| | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | | runtime filters: RF013[min_max] <- c_customer_sk
-| | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=9,10 row-size=16B cardinality=2.88M
| | | in pipelines: 10(GETNEXT), 11(OPEN)
| | |
@@ -1303,7 +1303,7 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| output: count:merge(*)
| group by: itemdesc, i_item_sk, d_date
| having: count(*) > CAST(4 AS BIGINT)
-| mem-estimate=49.40MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=46.41MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=50B cardinality=235.45K
| in pipelines: 57(GETNEXT), 04(OPEN)
|
@@ -1313,11 +1313,11 @@ Per-Host Resources: mem-estimate=74.93MB mem-reservation=39.88MB thread-reservat
| in pipelines: 04(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=64.00MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=61.76MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
09:AGGREGATE [STREAMING]
| output: count(*)
| group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
-| mem-estimate=37.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=50B cardinality=2.35M
| in pipelines: 04(GETNEXT)
|
@@ -1387,8 +1387,8 @@ Per-Host Resources: mem-estimate=64.00MB mem-reservation=43.19MB thread-reservat
tuple-ids=3 row-size=12B cardinality=2.88M
in pipelines: 04(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=560.38MB Threads=67
-Per-Host Resource Estimates: Memory=1.19GB
+Max Per-Host Resource Reservation: Memory=530.38MB Threads=67
+Per-Host Resource Estimates: Memory=1.16GB
F35:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1610,17 +1610,17 @@ Per-Instance Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reser
| | | | | hash-table-id=14
| | | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | | | | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | | | | tuple-ids=32,34,33 row-size=28B cardinality=2.35M
| | | | | in pipelines: 38(GETNEXT), 39(OPEN)
| | | | |
| | | | |--F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | | | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | | | | JOIN BUILD
| | | | | | join-table-id=14 plan-id=15 cohort-id=08
| | | | | | build expressions: c_customer_sk
| | | | | | runtime filters: RF033[min_max] <- c_customer_sk
-| | | | | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | | | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | | | | |
| | | | | 82:EXCHANGE [BROADCAST]
| | | | | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -1691,17 +1691,17 @@ Per-Instance Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reser
| | | | hash-table-id=16
| | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | | | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | | | tuple-ids=30,31 row-size=16B cardinality=2.88M
| | | | in pipelines: 36(GETNEXT), 37(OPEN)
| | | |
| | | |--F52:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | | | JOIN BUILD
| | | | | join-table-id=16 plan-id=17 cohort-id=07
| | | | | build expressions: c_customer_sk
| | | | | runtime filters: RF031[min_max] <- c_customer_sk
-| | | | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | | | |
| | | | 80:EXCHANGE [BROADCAST]
| | | | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -2080,17 +2080,17 @@ Per-Instance Resources: mem-estimate=54.32MB mem-reservation=36.00MB thread-rese
| | | | hash-table-id=04
| | | | hash predicates: ss_customer_sk = c_customer_sk
| | | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | | | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | | | tuple-ids=11,13,12 row-size=28B cardinality=2.35M
| | | | in pipelines: 12(GETNEXT), 13(OPEN)
| | | |
| | | |--F40:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | | | JOIN BUILD
| | | | | join-table-id=04 plan-id=05 cohort-id=04
| | | | | build expressions: c_customer_sk
| | | | | runtime filters: RF015[min_max] <- c_customer_sk
-| | | | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | | | |
| | | | 61:EXCHANGE [BROADCAST]
| | | | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
@@ -2161,17 +2161,17 @@ Per-Instance Resources: mem-estimate=54.32MB mem-reservation=36.00MB thread-rese
| | | hash-table-id=06
| | | hash predicates: ss_customer_sk = c_customer_sk
| | | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=9,10 row-size=16B cardinality=2.88M
| | | in pipelines: 10(GETNEXT), 11(OPEN)
| | |
| | |--F42:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | | Per-Instance Resources: mem-estimate=17.39MB mem-reservation=17.00MB thread-reservation=1
+| | | | Per-Instance Resources: mem-estimate=9.89MB mem-reservation=9.50MB thread-reservation=1
| | | JOIN BUILD
| | | | join-table-id=06 plan-id=07 cohort-id=03
| | | | build expressions: c_customer_sk
| | | | runtime filters: RF013[min_max] <- c_customer_sk
-| | | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | | |
| | | 59:EXCHANGE [BROADCAST]
| | | | mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test
index ccdd930..c146642 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test
@@ -81,7 +81,7 @@ PLAN-ROOT SINK
| 24:AGGREGATE [FINALIZE]
| | output: sum(ss_net_paid)
| | group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
-| | mem-estimate=114.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=111.88MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=16 row-size=154B cardinality=706.14K
| | in pipelines: 24(GETNEXT), 13(OPEN)
| |
@@ -320,7 +320,7 @@ PLAN-ROOT SINK
tuple-ids=5 row-size=60B cardinality=50.00K
in pipelines: 05(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=196.77MB Threads=32
+Max Per-Host Resource Reservation: Memory=193.02MB Threads=32
Per-Host Resource Estimates: Memory=1.12GB
F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.38MB mem-reservation=4.00MB thread-reservation=1
@@ -367,7 +367,7 @@ Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservat
| | in pipelines: 25(GETNEXT)
| |
| F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=48.65MB mem-reservation=34.00MB thread-reservation=1
+| Per-Host Resources: mem-estimate=47.76MB mem-reservation=34.00MB thread-reservation=1
| 25:AGGREGATE
| | output: avg(sum(ss_net_paid))
| | mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
@@ -377,7 +377,7 @@ Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservat
| 46:AGGREGATE [FINALIZE]
| | output: sum:merge(ss_net_paid)
| | group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
-| | mem-estimate=38.19MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=37.29MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=16 row-size=154B cardinality=706.14K
| | in pipelines: 46(GETNEXT), 13(OPEN)
| |
@@ -646,12 +646,12 @@ Per-Host Resources: mem-estimate=12.92MB mem-reservation=5.75MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=15.87MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=12.12MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
08:HASH JOIN [INNER JOIN, PARTITIONED]
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number, RF008[min_max] <- sr_item_sk, RF009[min_max] <- sr_ticket_number
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,2,1 row-size=165B cardinality=7.65K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -749,8 +749,8 @@ Per-Host Resources: mem-estimate=88.92MB mem-reservation=12.88MB thread-reservat
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=322.83MB Threads=42
-Per-Host Resource Estimates: Memory=674MB
+Max Per-Host Resource Reservation: Memory=319.08MB Threads=42
+Per-Host Resource Estimates: Memory=671MB
F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.59MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1145,17 +1145,17 @@ Per-Instance Resources: mem-estimate=1.44MB mem-reservation=0B thread-reservatio
| hash-table-id=08
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,2,1 row-size=165B cardinality=7.65K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F28:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=11.16MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+| | Per-Instance Resources: mem-estimate=9.28MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
| JOIN BUILD
| | join-table-id=08 plan-id=09 cohort-id=01
| | build expressions: sr_item_sk, sr_ticket_number
| | runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number, RF008[min_max] <- sr_item_sk, RF009[min_max] <- sr_ticket_number
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| |
| 31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
| | mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test
index 59ff1c3..8e19e37 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test
@@ -81,7 +81,7 @@ PLAN-ROOT SINK
| 24:AGGREGATE [FINALIZE]
| | output: sum(ss_net_paid)
| | group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
-| | mem-estimate=114.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=111.88MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=16 row-size=154B cardinality=706.14K
| | in pipelines: 24(GETNEXT), 13(OPEN)
| |
@@ -320,7 +320,7 @@ PLAN-ROOT SINK
tuple-ids=5 row-size=60B cardinality=50.00K
in pipelines: 05(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=196.77MB Threads=32
+Max Per-Host Resource Reservation: Memory=193.02MB Threads=32
Per-Host Resource Estimates: Memory=1.12GB
F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.38MB mem-reservation=4.00MB thread-reservation=1
@@ -367,7 +367,7 @@ Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservat
| | in pipelines: 25(GETNEXT)
| |
| F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=48.65MB mem-reservation=34.00MB thread-reservation=1
+| Per-Host Resources: mem-estimate=47.76MB mem-reservation=34.00MB thread-reservation=1
| 25:AGGREGATE
| | output: avg(sum(ss_net_paid))
| | mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
@@ -377,7 +377,7 @@ Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservat
| 46:AGGREGATE [FINALIZE]
| | output: sum:merge(ss_net_paid)
| | group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
-| | mem-estimate=38.19MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=37.29MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=16 row-size=154B cardinality=706.14K
| | in pipelines: 46(GETNEXT), 13(OPEN)
| |
@@ -646,12 +646,12 @@ Per-Host Resources: mem-estimate=12.92MB mem-reservation=5.75MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=15.87MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=12.12MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
08:HASH JOIN [INNER JOIN, PARTITIONED]
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number, RF008[min_max] <- sr_item_sk, RF009[min_max] <- sr_ticket_number
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,2,1 row-size=165B cardinality=7.65K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -749,8 +749,8 @@ Per-Host Resources: mem-estimate=88.92MB mem-reservation=12.88MB thread-reservat
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=322.83MB Threads=42
-Per-Host Resource Estimates: Memory=674MB
+Max Per-Host Resource Reservation: Memory=319.08MB Threads=42
+Per-Host Resource Estimates: Memory=671MB
F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.59MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1145,17 +1145,17 @@ Per-Instance Resources: mem-estimate=1.44MB mem-reservation=0B thread-reservatio
| hash-table-id=08
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,2,1 row-size=165B cardinality=7.65K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F28:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=11.16MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+| | Per-Instance Resources: mem-estimate=9.28MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
| JOIN BUILD
| | join-table-id=08 plan-id=09 cohort-id=01
| | build expressions: sr_item_sk, sr_ticket_number
| | runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number, RF008[min_max] <- sr_item_sk, RF009[min_max] <- sr_ticket_number
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| |
| 31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
| | mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test
index 4becf8c..ed97fe8 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test
@@ -212,8 +212,8 @@ PLAN-ROOT SINK
tuple-ids=7 row-size=148B cardinality=18.00K
in pipelines: 07(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=70.52MB Threads=20
-Per-Host Resource Estimates: Memory=710MB
+Max Per-Host Resource Reservation: Memory=69.59MB Threads=20
+Per-Host Resource Estimates: Memory=709MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.08MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -248,7 +248,7 @@ Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservati
| in pipelines: 02(GETNEXT)
|
F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=16.84MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=15.90MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
15:AGGREGATE [STREAMING]
| output: sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
| group by: i_item_id, i_item_desc, s_store_id, s_store_name
@@ -260,7 +260,7 @@ Per-Host Resources: mem-estimate=16.84MB mem-reservation=5.88MB thread-reservati
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=313B cardinality=449
| in pipelines: 02(GETNEXT), 07(OPEN)
|
@@ -468,8 +468,8 @@ Per-Host Resources: mem-estimate=203.73MB mem-reservation=18.81MB thread-reserva
tuple-ids=2 row-size=20B cardinality=1.44M
in pipelines: 02(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=92.21MB Threads=22
-Per-Host Resource Estimates: Memory=290MB
+Max Per-Host Resource Reservation: Memory=91.27MB Threads=22
+Per-Host Resource Estimates: Memory=289MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.08MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -516,17 +516,17 @@ Per-Instance Resources: mem-estimate=10.27MB mem-reservation=2.00MB thread-reser
| hash-table-id=00
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=313B cardinality=449
| in pipelines: 02(GETNEXT), 07(OPEN)
|
|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=6.57MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| |
| 25:EXCHANGE [HASH(i_item_sk)]
| | mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test
index 3996310..622a246 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test
@@ -23,10 +23,10 @@ GROUP BY i_item_id
ORDER BY i_item_id
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=52.78MB Threads=6
-Per-Host Resource Estimates: Memory=588MB
+Max Per-Host Resource Reservation: Memory=43.34MB Threads=6
+Per-Host Resource Estimates: Memory=578MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=587.75MB mem-reservation=52.78MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=578.31MB mem-reservation=43.34MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: i_item_id, avg(cs_quantity), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -48,7 +48,7 @@ PLAN-ROOT SINK
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -85,7 +85,7 @@ PLAN-ROOT SINK
| hash predicates: cs_bill_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
| runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=187.48K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -134,8 +134,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=36B cardinality=1.44M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=51.47MB Threads=13
-Per-Host Resource Estimates: Memory=613MB
+Max Per-Host Resource Reservation: Memory=50.53MB Threads=13
+Per-Host Resource Estimates: Memory=612MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -170,7 +170,7 @@ Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=32.36MB mem-reservation=14.56MB thread-reservation=1 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=31.42MB mem-reservation=13.62MB thread-reservation=1 runtime-filters-memory=3.00MB
09:AGGREGATE [STREAMING]
| output: avg(CAST(cs_quantity AS BIGINT)), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
| group by: i_item_id
@@ -182,7 +182,7 @@ Per-Host Resources: mem-estimate=32.36MB mem-reservation=14.56MB thread-reservat
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -303,8 +303,8 @@ Per-Host Resources: mem-estimate=389.95MB mem-reservation=21.94MB thread-reserva
tuple-ids=0 row-size=36B cardinality=1.44M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=59.22MB Threads=12
-Per-Host Resource Estimates: Memory=172MB
+Max Per-Host Resource Reservation: Memory=57.34MB Threads=12
+Per-Host Resource Estimates: Memory=171MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -351,17 +351,17 @@ Per-Instance Resources: mem-estimate=14.27MB mem-reservation=2.00MB thread-reser
| hash-table-id=00
| hash predicates: cs_item_sk = i_item_sk
| fk/pk conjuncts: cs_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
|--F08:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 15:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test
index 2d1ae98..c20d314 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test
@@ -20,10 +20,10 @@ order by i_item_id
,s_state
limit 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=40.77MB Threads=6
-Per-Host Resource Estimates: Memory=300MB
+Max Per-Host Resource Reservation: Memory=31.33MB Threads=6
+Per-Host Resource Estimates: Memory=290MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=299.75MB mem-reservation=40.77MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=290.31MB mem-reservation=31.33MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END, aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN 0 WHEN 8 THEN 1 WHEN 10 THEN 1 END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_quantity) WHEN 8 THEN avg(ss_quantity) WHEN 10 THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (6, 8, 1 [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -59,7 +59,7 @@ PLAN-ROOT SINK
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,3,4 row-size=150B cardinality=263.34K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
@@ -98,7 +98,7 @@ PLAN-ROOT SINK
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
| runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -148,8 +148,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=62.39MB Threads=12
-Per-Host Resource Estimates: Memory=379MB
+Max Per-Host Resource Reservation: Memory=52.95MB Threads=12
+Per-Host Resource Estimates: Memory=370MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -198,7 +198,7 @@ Per-Host Resources: mem-estimate=40.00MB mem-reservation=9.62MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=175.28MB mem-reservation=39.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+Per-Host Resources: mem-estimate=165.85MB mem-reservation=30.31MB thread-reservation=2 runtime-filters-memory=4.00MB
09:AGGREGATE [STREAMING]
| Class 0
| output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
@@ -217,7 +217,7 @@ Per-Host Resources: mem-estimate=175.28MB mem-reservation=39.75MB thread-reserva
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,3,4 row-size=150B cardinality=263.34K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
@@ -270,7 +270,7 @@ Per-Host Resources: mem-estimate=175.28MB mem-reservation=39.75MB thread-reserva
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
| runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -334,8 +334,8 @@ Per-Host Resources: mem-estimate=175.28MB mem-reservation=39.75MB thread-reserva
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=108.02MB Threads=13
-Per-Host Resource Estimates: Memory=301MB
+Max Per-Host Resource Reservation: Memory=89.14MB Threads=13
+Per-Host Resource Estimates: Memory=282MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -404,17 +404,17 @@ Per-Instance Resources: mem-estimate=46.00MB mem-reservation=12.00MB thread-rese
| hash-table-id=00
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,2,1,3,4 row-size=150B cardinality=263.34K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 15:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -473,17 +473,17 @@ Per-Instance Resources: mem-estimate=46.00MB mem-reservation=12.00MB thread-rese
| hash-table-id=02
| hash predicates: ss_cdemo_sk = cd_demo_sk
| fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
| tuple-ids=0,2,1 row-size=96B cardinality=263.34K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=39.84MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=22.84MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=02 plan-id=03 cohort-id=01
| | build expressions: cd_demo_sk
| | runtime filters: RF004[bloom] <- cd_demo_sk, RF005[min_max] <- cd_demo_sk
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
| |
| 13:EXCHANGE [BROADCAST]
| | mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test
index d42a27f..c10d0db 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test
@@ -212,8 +212,8 @@ PLAN-ROOT SINK
tuple-ids=7 row-size=148B cardinality=18.00K
in pipelines: 07(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=70.52MB Threads=20
-Per-Host Resource Estimates: Memory=695MB
+Max Per-Host Resource Reservation: Memory=69.59MB Threads=20
+Per-Host Resource Estimates: Memory=694MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -248,7 +248,7 @@ Per-Host Resources: mem-estimate=10.91MB mem-reservation=1.94MB thread-reservati
| in pipelines: 02(GETNEXT)
|
F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=17.34MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=16.40MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
15:AGGREGATE [STREAMING]
| output: sum(CAST(ss_quantity AS BIGINT)), sum(CAST(sr_return_quantity AS BIGINT)), sum(CAST(cs_quantity AS BIGINT))
| group by: i_item_id, i_item_desc, s_store_id, s_store_name
@@ -260,7 +260,7 @@ Per-Host Resources: mem-estimate=17.34MB mem-reservation=5.88MB thread-reservati
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=309B cardinality=4.25K
| in pipelines: 02(GETNEXT), 07(OPEN)
|
@@ -468,8 +468,8 @@ Per-Host Resources: mem-estimate=203.74MB mem-reservation=18.81MB thread-reserva
tuple-ids=2 row-size=20B cardinality=1.44M
in pipelines: 02(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=92.21MB Threads=22
-Per-Host Resource Estimates: Memory=291MB
+Max Per-Host Resource Reservation: Memory=91.27MB Threads=22
+Per-Host Resource Estimates: Memory=290MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -516,17 +516,17 @@ Per-Instance Resources: mem-estimate=10.77MB mem-reservation=2.00MB thread-reser
| hash-table-id=00
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,1,4,5,6,7 row-size=309B cardinality=4.25K
| in pipelines: 02(GETNEXT), 07(OPEN)
|
|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=6.57MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| |
| 25:EXCHANGE [HASH(i_item_sk)]
| | mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test
index 62da82c..f93f1da 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test
@@ -43,10 +43,10 @@ order by
c_preferred_cust_flag desc
limit 100000
---- PLAN
-Max Per-Host Resource Reservation: Memory=15.69MB Threads=6
+Max Per-Host Resource Reservation: Memory=14.75MB Threads=6
Per-Host Resource Estimates: Memory=298MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=297.81MB mem-reservation=15.69MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=297.81MB mem-reservation=14.75MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -69,7 +69,7 @@ PLAN-ROOT SINK
| | output: count(*)
| | group by: ss_ticket_number, ss_customer_sk
| | having: count(*) <= CAST(20 AS BIGINT), count(*) >= CAST(15 AS BIGINT)
-| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=4 row-size=20B cardinality=3.15K
| | in pipelines: 07(GETNEXT), 00(OPEN)
| |
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test
index a7537f5..aba88cf 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test
@@ -58,10 +58,10 @@ FROM customer c,
cd_dep_college_count
LIMIT 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=70.75MB Threads=8
-Per-Host Resource Estimates: Memory=417MB
+Max Per-Host Resource Reservation: Memory=67.00MB Threads=8
+Per-Host Resource Estimates: Memory=413MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=416.62MB mem-reservation=70.75MB thread-reservation=8 runtime-filters-memory=7.00MB
+| Per-Host Resources: mem-estimate=412.88MB mem-reservation=67.00MB thread-reservation=8 runtime-filters-memory=7.00MB
PLAN-ROOT SINK
| output exprs: ca_state, cd_gender, cd_marital_status, cd_dep_count, count(*), min(cd_dep_count), max(cd_dep_count), avg(cd_dep_count), cd_dep_employed_count, count(*), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(cd_dep_employed_count), cd_dep_college_count, count(*), min(cd_dep_college_count), max(cd_dep_college_count), avg(cd_dep_college_count)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -82,7 +82,7 @@ PLAN-ROOT SINK
16:HASH JOIN [LEFT SEMI JOIN]
| hash predicates: c.c_customer_sk = customsk
| runtime filters: RF000[bloom] <- customsk, RF001[min_max] <- customsk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=2,0,1 row-size=72B cardinality=90.63K
| in pipelines: 02(GETNEXT), 07(OPEN), 10(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
index 16464a1..1443769 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
@@ -29,9 +29,9 @@ FROM
LIMIT 100
---- PLAN
Max Per-Host Resource Reservation: Memory=190.94MB Threads=10
-Per-Host Resource Estimates: Memory=655MB
+Per-Host Resource Estimates: Memory=623MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=655.42MB mem-reservation=190.94MB thread-reservation=10 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=622.94MB mem-reservation=190.94MB thread-reservation=10 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: count(*)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -47,13 +47,13 @@ PLAN-ROOT SINK
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF000[bloom] <- c_first_name, RF001[bloom] <- c_last_name, RF002[bloom] <- d_date
-| mem-estimate=71.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=63.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3,8,13 row-size=174B cardinality=2.88M
| in pipelines: 05(GETNEXT), 17(OPEN)
|
|--17:AGGREGATE [FINALIZE]
| | group by: c_last_name, c_first_name, d_date
-| | mem-estimate=50.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=48.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=58B cardinality=719.38K
| | in pipelines: 17(GETNEXT), 12(OPEN)
| |
@@ -111,13 +111,13 @@ PLAN-ROOT SINK
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF003[bloom] <- c_first_name, RF004[bloom] <- c_last_name, RF005[bloom] <- d_date
-| mem-estimate=143.69MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=127.69MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3,8 row-size=116B cardinality=2.88M
| in pipelines: 05(GETNEXT), 11(OPEN)
|
|--11:AGGREGATE [FINALIZE]
| | group by: c_last_name, c_first_name, d_date
-| | mem-estimate=101.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=96.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=8 row-size=58B cardinality=1.44M
| | in pipelines: 11(GETNEXT), 06(OPEN)
| |
@@ -173,7 +173,7 @@ PLAN-ROOT SINK
|
05:AGGREGATE [FINALIZE]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=203.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=192.19MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 05(GETNEXT), 00(OPEN)
|
@@ -231,7 +231,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=340.81MB Threads=22
-Per-Host Resource Estimates: Memory=915MB
+Per-Host Resource Estimates: Memory=903MB
F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -251,7 +251,7 @@ PLAN-ROOT SINK
| in pipelines: 20(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=186.11MB mem-reservation=108.00MB thread-reservation=1 runtime-filters-memory=6.00MB
+Per-Host Resources: mem-estimate=177.11MB mem-reservation=108.00MB thread-reservation=1 runtime-filters-memory=6.00MB
20:AGGREGATE
| output: count(*)
| mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
@@ -360,7 +360,7 @@ Per-Host Resources: mem-estimate=186.11MB mem-reservation=108.00MB thread-reserv
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF003[bloom] <- c_first_name, RF004[bloom] <- c_last_name, RF005[bloom] <- d_date
-| mem-estimate=47.90MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=42.56MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3,8 row-size=116B cardinality=2.88M
| in pipelines: 24(GETNEXT), 28(OPEN)
|
@@ -456,7 +456,7 @@ Per-Host Resources: mem-estimate=186.11MB mem-reservation=108.00MB thread-reserv
|
24:AGGREGATE [FINALIZE]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=67.73MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=64.06MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 24(GETNEXT), 00(OPEN)
|
@@ -466,10 +466,10 @@ Per-Host Resources: mem-estimate=186.11MB mem-reservation=108.00MB thread-reserv
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=83.33MB mem-reservation=46.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=80.58MB mem-reservation=46.94MB thread-reservation=2 runtime-filters-memory=2.00MB
05:AGGREGATE [STREAMING]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=50.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=48.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test
index 7b93d56..9778892 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test
@@ -59,9 +59,9 @@ ORDER BY inv1.w_warehouse_sk,
inv2.cov ;
---- PLAN
Max Per-Host Resource Reservation: Memory=131.81MB Threads=9
-Per-Host Resource Estimates: Memory=913MB
+Per-Host Resource Estimates: Memory=880MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=913.32MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
+| Per-Host Resources: mem-estimate=880.41MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
PLAN-ROOT SINK
| output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
| mem-estimate=26.33MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -76,7 +76,7 @@ PLAN-ROOT SINK
| hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
| fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk, RF002[min_max] <- i_item_sk, RF003[min_max] <- w_warehouse_sk
-| mem-estimate=49.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=42.51MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5,13 row-size=123B cardinality=431.40K
| in pipelines: 07(GETNEXT), 15(OPEN)
|
@@ -84,7 +84,7 @@ PLAN-ROOT SINK
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=318.85MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=302.39MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 15(GETNEXT), 08(OPEN)
| |
@@ -160,7 +160,7 @@ PLAN-ROOT SINK
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| mem-estimate=318.85MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=302.39MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -235,7 +235,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=237.16MB Threads=20
-Per-Host Resource Estimates: Memory=1.15GB
+Per-Host Resource Estimates: Memory=1.12GB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=39.63MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -270,12 +270,12 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| | in pipelines: 27(GETNEXT)
| |
| F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+| Per-Host Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
| 27:AGGREGATE [FINALIZE]
| | output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 27(GETNEXT), 08(OPEN)
| |
@@ -285,11 +285,11 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| | in pipelines: 08(GETNEXT)
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=270.67MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=263.77MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
| 15:AGGREGATE [STREAMING]
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| | mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=12 row-size=62B cardinality=4.31M
| | in pipelines: 08(GETNEXT)
| |
@@ -388,12 +388,12 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| in pipelines: 22(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
22:AGGREGATE [FINALIZE]
| output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 22(GETNEXT), 00(OPEN)
|
@@ -403,11 +403,11 @@ Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=272.67MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+Per-Host Resources: mem-estimate=265.77MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
07:AGGREGATE [STREAMING]
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=62B cardinality=4.31M
| in pipelines: 00(GETNEXT)
|
@@ -503,7 +503,7 @@ Per-Host Resources: mem-estimate=272.67MB mem-reservation=60.81MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=254.78MB Threads=19
-Per-Host Resource Estimates: Memory=915MB
+Per-Host Resource Estimates: Memory=885MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=39.63MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -546,12 +546,12 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| | in pipelines: 27(GETNEXT)
| |
| F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-| Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
| 27:AGGREGATE [FINALIZE]
| | output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 27(GETNEXT), 08(OPEN)
| |
@@ -562,11 +562,11 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
| Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
-| Per-Instance Resources: mem-estimate=165.68MB mem-reservation=50.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=158.78MB mem-reservation=50.00MB thread-reservation=1
| 15:AGGREGATE [STREAMING]
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| | mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=12 row-size=62B cardinality=4.31M
| | in pipelines: 08(GETNEXT)
| |
@@ -689,12 +689,12 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| in pipelines: 22(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
22:AGGREGATE [FINALIZE]
| output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 22(GETNEXT), 00(OPEN)
|
@@ -705,11 +705,11 @@ Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-res
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
-Per-Instance Resources: mem-estimate=165.68MB mem-reservation=50.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=158.78MB mem-reservation=50.00MB thread-reservation=1
07:AGGREGATE [STREAMING]
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=62B cardinality=4.31M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test
index 1e41f0c..da8d7f8 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test
@@ -60,9 +60,9 @@ ORDER BY inv1.w_warehouse_sk,
inv2.cov ;
---- PLAN
Max Per-Host Resource Reservation: Memory=131.81MB Threads=9
-Per-Host Resource Estimates: Memory=913MB
+Per-Host Resource Estimates: Memory=880MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=913.32MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
+| Per-Host Resources: mem-estimate=880.41MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
PLAN-ROOT SINK
| output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
| mem-estimate=26.33MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -77,7 +77,7 @@ PLAN-ROOT SINK
| hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
| fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk, RF002[min_max] <- i_item_sk, RF003[min_max] <- w_warehouse_sk
-| mem-estimate=49.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=42.51MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5,13 row-size=123B cardinality=431.40K
| in pipelines: 07(GETNEXT), 15(OPEN)
|
@@ -85,7 +85,7 @@ PLAN-ROOT SINK
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=318.85MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=302.39MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 15(GETNEXT), 08(OPEN)
| |
@@ -161,7 +161,7 @@ PLAN-ROOT SINK
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
-| mem-estimate=318.85MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=302.39MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -236,7 +236,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=237.16MB Threads=20
-Per-Host Resource Estimates: Memory=1.15GB
+Per-Host Resource Estimates: Memory=1.12GB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=39.63MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -271,12 +271,12 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| | in pipelines: 27(GETNEXT)
| |
| F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+| Per-Host Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
| 27:AGGREGATE [FINALIZE]
| | output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 27(GETNEXT), 08(OPEN)
| |
@@ -286,11 +286,11 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| | in pipelines: 08(GETNEXT)
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=270.67MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=263.77MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
| 15:AGGREGATE [STREAMING]
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| | mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=12 row-size=62B cardinality=4.31M
| | in pipelines: 08(GETNEXT)
| |
@@ -389,12 +389,12 @@ Per-Host Resources: mem-estimate=59.29MB mem-reservation=42.00MB thread-reservat
| in pipelines: 22(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
22:AGGREGATE [FINALIZE]
| output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
-| mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 22(GETNEXT), 00(OPEN)
|
@@ -404,11 +404,11 @@ Per-Host Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=272.67MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+Per-Host Resources: mem-estimate=265.77MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
07:AGGREGATE [STREAMING]
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=62B cardinality=4.31M
| in pipelines: 00(GETNEXT)
|
@@ -504,7 +504,7 @@ Per-Host Resources: mem-estimate=272.67MB mem-reservation=60.81MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=254.78MB Threads=19
-Per-Host Resource Estimates: Memory=915MB
+Per-Host Resource Estimates: Memory=885MB
F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=39.63MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -547,12 +547,12 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| | in pipelines: 27(GETNEXT)
| |
| F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-| Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
| 27:AGGREGATE [FINALIZE]
| | output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| | having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
-| | mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=62B cardinality=431.40K
| | in pipelines: 27(GETNEXT), 08(OPEN)
| |
@@ -563,11 +563,11 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| |
| F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
| Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
-| Per-Instance Resources: mem-estimate=165.68MB mem-reservation=50.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=158.78MB mem-reservation=50.00MB thread-reservation=1
| 15:AGGREGATE [STREAMING]
| | output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| | group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| | mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=12 row-size=62B cardinality=4.31M
| | in pipelines: 08(GETNEXT)
| |
@@ -690,12 +690,12 @@ Per-Instance Resources: mem-estimate=23.29MB mem-reservation=6.00MB thread-reser
| in pipelines: 22(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
-Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=161.32MB mem-reservation=34.00MB thread-reservation=1
22:AGGREGATE [FINALIZE]
| output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
| having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
-| mem-estimate=159.42MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=151.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=62B cardinality=431.40K
| in pipelines: 22(GETNEXT), 00(OPEN)
|
@@ -706,11 +706,11 @@ Per-Instance Resources: mem-estimate=169.55MB mem-reservation=34.00MB thread-res
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
-Per-Instance Resources: mem-estimate=165.68MB mem-reservation=50.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=158.78MB mem-reservation=50.00MB thread-reservation=1
07:AGGREGATE [STREAMING]
| output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
| group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
-| mem-estimate=133.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=126.78MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=62B cardinality=4.31M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test
index 39c1d0a..9e8add1 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test
@@ -41,10 +41,10 @@ ORDER BY ca_zip,
ca_city
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=44.25MB Threads=7
-Per-Host Resource Estimates: Memory=356MB
+Max Per-Host Resource Reservation: Memory=35.81MB Threads=7
+Per-Host Resource Estimates: Memory=347MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=355.81MB mem-reservation=44.25MB thread-reservation=7 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=347.38MB mem-reservation=35.81MB thread-reservation=7 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: ca_zip, ca_city, sum(ws_sales_price)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -93,7 +93,7 @@ PLAN-ROOT SINK
| hash predicates: ws_item_sk = i_item_sk
| fk/pk conjuncts: ws_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,3,1,2,4 row-size=118B cardinality=73.80K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
@@ -111,7 +111,7 @@ PLAN-ROOT SINK
| hash predicates: c_current_addr_sk = ca_address_sk
| fk/pk conjuncts: c_current_addr_sk = ca_address_sk
| runtime filters: RF002[bloom] <- ca_address_sk, RF003[min_max] <- ca_address_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,1,2 row-size=82B cardinality=73.80K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
@@ -129,7 +129,7 @@ PLAN-ROOT SINK
| hash predicates: ws_bill_customer_sk = c_customer_sk
| fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
| runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=40B cardinality=73.80K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -176,8 +176,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=20B cardinality=719.38K
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=52.69MB Threads=16
-Per-Host Resource Estimates: Memory=397MB
+Max Per-Host Resource Reservation: Memory=46.12MB Threads=16
+Per-Host Resource Estimates: Memory=390MB
F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -212,7 +212,7 @@ Per-Host Resources: mem-estimate=12.01MB mem-reservation=4.75MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=2 instances=2
-Per-Host Resources: mem-estimate=25.79MB mem-reservation=14.56MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=22.98MB mem-reservation=11.75MB thread-reservation=1 runtime-filters-memory=2.00MB
12:AGGREGATE [STREAMING]
| output: sum(ws_sales_price)
| group by: ca_zip, ca_city
@@ -271,7 +271,7 @@ Per-Host Resources: mem-estimate=25.79MB mem-reservation=14.56MB thread-reservat
| hash predicates: ws_item_sk = i_item_sk
| fk/pk conjuncts: ws_item_sk = i_item_sk
| runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,3,1,2,4 row-size=118B cardinality=73.80K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
@@ -296,7 +296,7 @@ Per-Host Resources: mem-estimate=25.79MB mem-reservation=14.56MB thread-reservat
| hash predicates: c_current_addr_sk = ca_address_sk
| fk/pk conjuncts: c_current_addr_sk = ca_address_sk
| runtime filters: RF002[bloom] <- ca_address_sk, RF003[min_max] <- ca_address_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,1,2 row-size=82B cardinality=73.80K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
@@ -323,12 +323,12 @@ Per-Host Resources: mem-estimate=25.79MB mem-reservation=14.56MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=142.23MB mem-reservation=21.44MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=138.48MB mem-reservation=17.69MB thread-reservation=2 runtime-filters-memory=3.00MB
08:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: ws_bill_customer_sk = c_customer_sk
| fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
| runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=40B cardinality=73.80K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -389,8 +389,8 @@ Per-Host Resources: mem-estimate=142.23MB mem-reservation=21.44MB thread-reserva
tuple-ids=0 row-size=20B cardinality=719.38K
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=69.94MB Threads=15
-Per-Host Resource Estimates: Memory=206MB
+Max Per-Host Resource Reservation: Memory=58.69MB Threads=15
+Per-Host Resource Estimates: Memory=195MB
F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -492,17 +492,17 @@ Per-Instance Resources: mem-estimate=11.51MB mem-reservation=3.00MB thread-reser
| hash-table-id=01
| hash predicates: ws_item_sk = i_item_sk
| fk/pk conjuncts: ws_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,3,1,2,4 row-size=118B cardinality=73.80K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
|--F11:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=2 instances=2
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=01 plan-id=02 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF000[bloom] <- i_item_sk, RF001[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 18:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -525,17 +525,17 @@ Per-Instance Resources: mem-estimate=11.51MB mem-reservation=3.00MB thread-reser
| hash-table-id=02
| hash predicates: c_current_addr_sk = ca_address_sk
| fk/pk conjuncts: c_current_addr_sk = ca_address_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,1,2 row-size=82B cardinality=73.80K
| in pipelines: 00(GETNEXT), 02(OPEN)
|
|--F12:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=2 instances=2
-| | Per-Instance Resources: mem-estimate=7.79MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.92MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=02 plan-id=03 cohort-id=01
| | build expressions: ca_address_sk
| | runtime filters: RF002[bloom] <- ca_address_sk, RF003[min_max] <- ca_address_sk
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| |
| 17:EXCHANGE [HASH(ca_address_sk)]
| | mem-estimate=2.04MB mem-reservation=0B thread-reservation=0
@@ -566,17 +566,17 @@ Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reser
| hash-table-id=03
| hash predicates: ws_bill_customer_sk = c_customer_sk
| fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=40B cardinality=73.80K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| | Per-Instance Resources: mem-estimate=18.77MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=11.27MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=03 plan-id=04 cohort-id=01
| | build expressions: c_customer_sk
| | runtime filters: RF004[bloom] <- c_customer_sk, RF005[min_max] <- c_customer_sk
-| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| |
| 15:EXCHANGE [BROADCAST]
| | mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test
index 29c69be..4c08d3d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test
@@ -50,10 +50,10 @@ order by
ss_ticket_number
limit 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=78.81MB Threads=8
-Per-Host Resource Estimates: Memory=406MB
+Max Per-Host Resource Reservation: Memory=70.31MB Threads=8
+Per-Host Resource Estimates: Memory=398MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=406.31MB mem-reservation=78.81MB thread-reservation=8 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=397.81MB mem-reservation=70.31MB thread-reservation=8 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, amt, profit
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -87,7 +87,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=5,7 row-size=113B cardinality=230.45K
| in pipelines: 09(GETNEXT), 10(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test
index 8f945da..a3dc044 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test
@@ -66,7 +66,7 @@ PLAN-ROOT SINK
34:HASH JOIN [INNER JOIN]
| hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=104.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=95.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
| in pipelines: 21(GETNEXT), 31(OPEN)
|
@@ -88,7 +88,7 @@ PLAN-ROOT SINK
| 30:AGGREGATE [FINALIZE]
| | output: sum(ss_sales_price)
| | group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-| | mem-estimate=79.31MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=76.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=20 row-size=105B cardinality=685.36K
| | in pipelines: 30(GETNEXT), 24(OPEN)
| |
@@ -203,7 +203,7 @@ PLAN-ROOT SINK
| 07:AGGREGATE [FINALIZE]
| | output: sum(ss_sales_price)
| | group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-| | mem-estimate=79.31MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=76.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=4 row-size=105B cardinality=685.36K
| | in pipelines: 07(GETNEXT), 01(OPEN)
| |
@@ -292,7 +292,7 @@ PLAN-ROOT SINK
20:AGGREGATE [FINALIZE]
| output: sum(ss_sales_price)
| group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-| mem-estimate=79.31MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=76.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=12 row-size=105B cardinality=685.36K
| in pipelines: 20(GETNEXT), 14(OPEN)
|
@@ -364,7 +364,7 @@ PLAN-ROOT SINK
in pipelines: 14(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=330.51MB Threads=29
-Per-Host Resource Estimates: Memory=960MB
+Per-Host Resource Estimates: Memory=959MB
F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -379,7 +379,7 @@ PLAN-ROOT SINK
| in pipelines: 35(GETNEXT)
|
F15:PLAN FRAGMENT [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=55.95MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=55.11MB mem-reservation=34.00MB thread-reservation=1
35:TOP-N [LIMIT=100]
| order by: sum_sales - avg_monthly_sales ASC, d_year ASC
| mem-estimate=11.14KB mem-reservation=0B thread-reservation=0
@@ -389,7 +389,7 @@ Per-Host Resources: mem-estimate=55.95MB mem-reservation=34.00MB thread-reservat
34:HASH JOIN [INNER JOIN, PARTITIONED]
| hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=34.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
| in pipelines: 21(GETNEXT), 31(OPEN)
|
@@ -812,8 +812,8 @@ Per-Host Resources: mem-estimate=92.77MB mem-reservation=44.75MB thread-reservat
tuple-ids=9 row-size=20B cardinality=2.88M
in pipelines: 14(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=450.70MB Threads=36
-Per-Host Resource Estimates: Memory=731MB
+Max Per-Host Resource Reservation: Memory=416.70MB Threads=36
+Per-Host Resource Estimates: Memory=697MB
F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -839,16 +839,16 @@ Per-Instance Resources: mem-estimate=11.53MB mem-reservation=0B thread-reservati
| hash-table-id=00
| hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=0B mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
| tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
| in pipelines: 21(GETNEXT), 31(OPEN)
|
|--F17:PLAN FRAGMENT [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=44.71MB mem-reservation=34.00MB thread-reservation=1
+| | Per-Instance Resources: mem-estimate=27.71MB mem-reservation=17.00MB thread-reservation=1
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: rank() - 1, s_store_name, i_category, s_company_name, i_brand
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
| |
| 53:EXCHANGE [HASH(rank() - 1,s_store_name,i_category,s_company_name,i_brand)]
| | mem-estimate=10.71MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
index 7a41475..8bd224b 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
@@ -40,10 +40,10 @@ WHERE s_store_sk = ss_store_sk
AND ss_net_profit BETWEEN 50 AND 25000)) ;
---- PLAN
-Max Per-Host Resource Reservation: Memory=22.70MB Threads=6
+Max Per-Host Resource Reservation: Memory=21.77MB Threads=6
Per-Host Resource Estimates: Memory=250MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=249.81MB mem-reservation=22.70MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=249.81MB mem-reservation=21.77MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: sum(ss_quantity)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -77,7 +77,7 @@ PLAN-ROOT SINK
| fk/pk conjuncts: cd_demo_sk = ss_cdemo_sk
| other predicates: cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAS [...]
| runtime filters: RF002[bloom] <- ss_cdemo_sk, RF003[min_max] <- ss_cdemo_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=2,0,3,4 row-size=118B cardinality=8.56K
| in pipelines: 02(GETNEXT), 00(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test
index cbea81b..c99e386 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test
@@ -68,10 +68,10 @@ ORDER BY s_store_name,
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=67.62MB Threads=6
-Per-Host Resource Estimates: Memory=384MB
+Max Per-Host Resource Reservation: Memory=65.75MB Threads=6
+Per-Host Resource Estimates: Memory=382MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=383.62MB mem-reservation=67.62MB thread-reservation=6 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=381.75MB mem-reservation=65.75MB thread-reservation=6 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip, sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHE [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -93,7 +93,7 @@ PLAN-ROOT SINK
| hash predicates: ss_sold_date_sk = d1.d_date_sk
| fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
| runtime filters: RF000[bloom] <- d1.d_date_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -177,8 +177,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=69.71MB Threads=12
-Per-Host Resource Estimates: Memory=431MB
+Max Per-Host Resource Reservation: Memory=67.84MB Threads=12
+Per-Host Resource Estimates: Memory=429MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.07MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -213,7 +213,7 @@ Per-Host Resources: mem-estimate=25.26MB mem-reservation=17.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=112.55MB mem-reservation=42.62MB thread-reservation=2 runtime-filters-memory=6.00MB
+Per-Host Resources: mem-estimate=110.68MB mem-reservation=40.75MB thread-reservation=2 runtime-filters-memory=6.00MB
09:AGGREGATE [STREAMING]
| output: sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_ [...]
| group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
@@ -225,7 +225,7 @@ Per-Host Resources: mem-estimate=112.55MB mem-reservation=42.62MB thread-reserva
| hash predicates: ss_sold_date_sk = d1.d_date_sk
| fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
| runtime filters: RF000[bloom] <- d1.d_date_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
@@ -337,8 +337,8 @@ Per-Host Resources: mem-estimate=112.55MB mem-reservation=42.62MB thread-reserva
tuple-ids=0 row-size=28B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=103.34MB Threads=13
-Per-Host Resource Estimates: Memory=236MB
+Max Per-Host Resource Reservation: Memory=99.59MB Threads=13
+Per-Host Resource Estimates: Memory=232MB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.13MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -386,17 +386,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=7.00MB thread-reser
| hash-table-id=00
| hash predicates: ss_sold_date_sk = d1.d_date_sk
| fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
| in pipelines: 00(GETNEXT), 03(OPEN)
|
|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=10.79MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=7.04MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: d1.d_date_sk
| | runtime filters: RF000[bloom] <- d1.d_date_sk
-| | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
| |
| 14:EXCHANGE [BROADCAST]
| | mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test
index eb55f9d..d0aab8d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test
@@ -54,9 +54,9 @@ LIMIT 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=106.00MB Threads=5
-Per-Host Resource Estimates: Memory=637MB
+Per-Host Resource Estimates: Memory=629MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=636.59MB mem-reservation=106.00MB thread-reservation=5 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=628.59MB mem-reservation=106.00MB thread-reservation=5 runtime-filters-memory=2.00MB
PLAN-ROOT SINK
| output exprs: item_sk, d_date, web_sales, store_sales, web_cumulative, store_cumulative
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -91,7 +91,7 @@ PLAN-ROOT SINK
12:HASH JOIN [FULL OUTER JOIN]
| hash predicates: ss_item_sk = ws_item_sk, d_date = d_date
| fk/pk conjuncts: d_date = d_date
-| mem-estimate=74.54MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=66.54MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
| in pipelines: 10(GETNEXT), 04(OPEN)
|
@@ -113,7 +113,7 @@ PLAN-ROOT SINK
| 03:AGGREGATE [FINALIZE]
| | output: sum(ws_sales_price)
| | group by: ws_item_sk, d_date
-| | mem-estimate=42.54MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=39.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=2 row-size=46B cardinality=719.38K
| | in pipelines: 03(GETNEXT), 00(OPEN)
| |
@@ -169,7 +169,7 @@ PLAN-ROOT SINK
09:AGGREGATE [FINALIZE]
| output: sum(ss_sales_price)
| group by: ss_item_sk, d_date
-| mem-estimate=170.31MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=159.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=46B cardinality=2.88M
| in pipelines: 09(GETNEXT), 06(OPEN)
|
@@ -209,7 +209,7 @@ PLAN-ROOT SINK
in pipelines: 06(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=219.88MB Threads=13
-Per-Host Resource Estimates: Memory=732MB
+Per-Host Resource Estimates: Memory=726MB
F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -356,7 +356,7 @@ Per-Host Resources: mem-estimate=54.34MB mem-reservation=34.00MB thread-reservat
| in pipelines: 10(GETNEXT)
|
F02:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=102.89MB mem-reservation=50.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=99.23MB mem-reservation=50.00MB thread-reservation=1
11:ANALYTIC
| functions: sum(sum(ss_sales_price))
| partition by: ss_item_sk
@@ -375,7 +375,7 @@ Per-Host Resources: mem-estimate=102.89MB mem-reservation=50.00MB thread-reserva
19:AGGREGATE [FINALIZE]
| output: sum:merge(ss_sales_price)
| group by: ss_item_sk, d_date
-| mem-estimate=56.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=53.11MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=46B cardinality=2.88M
| in pipelines: 19(GETNEXT), 06(OPEN)
|
@@ -385,11 +385,11 @@ Per-Host Resources: mem-estimate=102.89MB mem-reservation=50.00MB thread-reserva
| in pipelines: 06(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=77.76MB mem-reservation=37.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=75.01MB mem-reservation=37.94MB thread-reservation=2 runtime-filters-memory=1.00MB
09:AGGREGATE [STREAMING]
| output: sum(ss_sales_price)
| group by: ss_item_sk, d_date
-| mem-estimate=42.58MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=39.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=46B cardinality=2.88M
| in pipelines: 06(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test
index bce620e..0a43b77 100755
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test
@@ -74,10 +74,10 @@ ORDER BY total_sales,
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=29.38MB Threads=6
+Max Per-Host Resource Reservation: Memory=28.44MB Threads=6
Per-Host Resource Estimates: Memory=362MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=361.81MB mem-reservation=29.38MB thread-reservation=6 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=361.81MB mem-reservation=28.44MB thread-reservation=6 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: i_item_id, sum(total_sales)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -230,7 +230,7 @@ PLAN-ROOT SINK
| | hash predicates: i_item_sk = cs_item_sk
| | fk/pk conjuncts: i_item_sk = cs_item_sk
| | runtime filters: RF011[min_max] <- cs_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=11,8,9,10 row-size=76B cardinality=14.35K
| | in pipelines: 14(GETNEXT), 11(OPEN)
| |
@@ -329,7 +329,7 @@ PLAN-ROOT SINK
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF003[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1,2,3 row-size=76B cardinality=27.62K
| in pipelines: 01(GETNEXT), 04(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test
index 214a27a..8a48590 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test
@@ -82,7 +82,7 @@ PLAN-ROOT SINK
34:HASH JOIN [INNER JOIN]
| hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=48.69MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=44.24MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
| in pipelines: 21(GETNEXT), 31(OPEN)
|
@@ -104,7 +104,7 @@ PLAN-ROOT SINK
| 30:AGGREGATE [FINALIZE]
| | output: sum(cs_sales_price)
| | group by: i_category, i_brand, cc_name, d_year, d_moy
-| | mem-estimate=35.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=20 row-size=94B cardinality=342.81K
| | in pipelines: 30(GETNEXT), 24(OPEN)
| |
@@ -218,7 +218,7 @@ PLAN-ROOT SINK
| 07:AGGREGATE [FINALIZE]
| | output: sum(cs_sales_price)
| | group by: i_category, i_brand, cc_name, d_year, d_moy
-| | mem-estimate=35.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=4 row-size=94B cardinality=342.81K
| | in pipelines: 07(GETNEXT), 01(OPEN)
| |
@@ -306,7 +306,7 @@ PLAN-ROOT SINK
20:AGGREGATE [FINALIZE]
| output: sum(cs_sales_price)
| group by: i_category, i_brand, cc_name, d_year, d_moy
-| mem-estimate=35.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=34.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=12 row-size=94B cardinality=342.81K
| in pipelines: 20(GETNEXT), 14(OPEN)
|
@@ -376,8 +376,8 @@ PLAN-ROOT SINK
tuple-ids=9 row-size=20B cardinality=1.44M
in pipelines: 14(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=237.48MB Threads=29
-Per-Host Resource Estimates: Memory=1.18GB
+Max Per-Host Resource Reservation: Memory=220.48MB Threads=29
+Per-Host Resource Estimates: Memory=1.16GB
F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.05MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -392,7 +392,7 @@ PLAN-ROOT SINK
| in pipelines: 35(GETNEXT)
|
F15:PLAN FRAGMENT [HASH(rank(),i_category,cc_name,i_brand)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=55.01MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=38.01MB mem-reservation=17.00MB thread-reservation=1
35:TOP-N [LIMIT=100]
| order by: sum_sales - avg_monthly_sales ASC
| mem-estimate=13.86KB mem-reservation=0B thread-reservation=0
@@ -402,7 +402,7 @@ Per-Host Resources: mem-estimate=55.01MB mem-reservation=34.00MB thread-reservat
34:HASH JOIN [INNER JOIN, PARTITIONED]
| hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
| tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
| in pipelines: 21(GETNEXT), 31(OPEN)
|
@@ -822,8 +822,8 @@ Per-Host Resources: mem-estimate=219.77MB mem-reservation=30.75MB thread-reserva
tuple-ids=9 row-size=20B cardinality=1.44M
in pipelines: 14(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=268.67MB Threads=28
-Per-Host Resource Estimates: Memory=567MB
+Max Per-Host Resource Reservation: Memory=251.67MB Threads=28
+Per-Host Resource Estimates: Memory=550MB
F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.05MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -849,16 +849,16 @@ Per-Instance Resources: mem-estimate=10.70MB mem-reservation=0B thread-reservati
| hash-table-id=00
| hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
| fk/pk conjuncts: none
-| mem-estimate=0B mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
| tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
| in pipelines: 21(GETNEXT), 31(OPEN)
|
|--F17:PLAN FRAGMENT [HASH(rank(),i_category,cc_name,i_brand)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=44.32MB mem-reservation=34.00MB thread-reservation=1
+| | Per-Instance Resources: mem-estimate=27.32MB mem-reservation=17.00MB thread-reservation=1
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: rank() - 1, i_category, cc_name, i_brand
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
| |
| 53:EXCHANGE [HASH(rank() - 1,i_category,cc_name,i_brand)]
| | mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test
index 6518060..eeace42 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test
@@ -70,10 +70,10 @@ ORDER BY ss_items.item_id,
ss_item_rev
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=69.00MB Threads=16
-Per-Host Resource Estimates: Memory=689MB
+Max Per-Host Resource Reservation: Memory=66.19MB Threads=16
+Per-Host Resource Estimates: Memory=686MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=688.88MB mem-reservation=69.00MB thread-reservation=16 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=686.06MB mem-reservation=66.19MB thread-reservation=16 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: item_id, ss_item_rev, ss_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), cs_item_rev, cs_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), ws_item_rev, ws_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), (ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -168,7 +168,7 @@ PLAN-ROOT SINK
| | hash predicates: cs_item_sk = i_item_sk
| | fk/pk conjuncts: cs_item_sk = i_item_sk
| | runtime filters: RF025[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=1.44M
| | in pipelines: 11(GETNEXT), 12(OPEN)
| |
@@ -277,7 +277,7 @@ PLAN-ROOT SINK
| | hash predicates: ws_item_sk = i_item_sk
| | fk/pk conjuncts: ws_item_sk = i_item_sk
| | runtime filters: RF017[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=18,19 row-size=52B cardinality=719.38K
| | in pipelines: 22(GETNEXT), 23(OPEN)
| |
@@ -378,7 +378,7 @@ PLAN-ROOT SINK
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -405,8 +405,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=16B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=95.69MB Threads=35
-Per-Host Resource Estimates: Memory=780MB
+Max Per-Host Resource Reservation: Memory=92.88MB Threads=35
+Per-Host Resource Estimates: Memory=777MB
F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -450,7 +450,7 @@ Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservat
| | in pipelines: 11(GETNEXT)
| |
| F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=167.08MB mem-reservation=20.56MB thread-reservation=2 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=166.14MB mem-reservation=19.62MB thread-reservation=2 runtime-filters-memory=1.00MB
| 21:AGGREGATE [STREAMING]
| | output: sum(cs_ext_sales_price)
| | group by: i_item_id
@@ -555,7 +555,7 @@ Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservat
| | hash predicates: cs_item_sk = i_item_sk
| | fk/pk conjuncts: cs_item_sk = i_item_sk
| | runtime filters: RF025[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=1.44M
| | in pipelines: 11(GETNEXT), 12(OPEN)
| |
@@ -609,7 +609,7 @@ Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservat
| | in pipelines: 22(GETNEXT)
| |
| F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| Per-Host Resources: mem-estimate=120.08MB mem-reservation=21.56MB thread-reservation=2 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=119.14MB mem-reservation=20.62MB thread-reservation=2 runtime-filters-memory=2.00MB
| 32:AGGREGATE [STREAMING]
| | output: sum(ws_ext_sales_price)
| | group by: i_item_id
@@ -714,7 +714,7 @@ Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservat
| | hash predicates: ws_item_sk = i_item_sk
| | fk/pk conjuncts: ws_item_sk = i_item_sk
| | runtime filters: RF017[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=18,19 row-size=52B cardinality=719.38K
| | in pipelines: 22(GETNEXT), 23(OPEN)
| |
@@ -760,7 +760,7 @@ Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=57.08MB mem-reservation=15.56MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=56.14MB mem-reservation=14.62MB thread-reservation=2 runtime-filters-memory=3.00MB
10:AGGREGATE [STREAMING]
| output: sum(ss_ext_sales_price)
| group by: i_item_id
@@ -865,7 +865,7 @@ Per-Host Resources: mem-estimate=57.08MB mem-reservation=15.56MB thread-reservat
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -899,8 +899,8 @@ Per-Host Resources: mem-estimate=57.08MB mem-reservation=15.56MB thread-reservat
tuple-ids=0 row-size=16B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=149.88MB Threads=38
-Per-Host Resource Estimates: Memory=514MB
+Max Per-Host Resource Reservation: Memory=144.25MB Threads=38
+Per-Host Resource Estimates: Memory=508MB
F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.05MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1083,17 +1083,17 @@ Per-Instance Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reser
| | hash-table-id=04
| | hash predicates: cs_item_sk = i_item_sk
| | fk/pk conjuncts: cs_item_sk = i_item_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=1.44M
| | in pipelines: 11(GETNEXT), 12(OPEN)
| |
| |--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | | Per-Instance Resources: mem-estimate=6.41MB mem-reservation=5.75MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=04 plan-id=05 cohort-id=02
| | | build expressions: i_item_sk
| | | runtime filters: RF025[min_max] <- i_item_sk
-| | | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 50:EXCHANGE [BROADCAST]
| | | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -1285,17 +1285,17 @@ Per-Instance Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reser
| | hash-table-id=09
| | hash predicates: ws_item_sk = i_item_sk
| | fk/pk conjuncts: ws_item_sk = i_item_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=18,19 row-size=52B cardinality=719.38K
| | in pipelines: 22(GETNEXT), 23(OPEN)
| |
| |--F31:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-| | | Per-Instance Resources: mem-estimate=6.41MB mem-reservation=5.75MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=09 plan-id=10 cohort-id=04
| | | build expressions: i_item_sk
| | | runtime filters: RF017[min_max] <- i_item_sk
-| | | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 43:EXCHANGE [BROADCAST]
| | | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -1471,17 +1471,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reser
| hash-table-id=13
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=2.88M
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=13 plan-id=14 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 36:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test
index 080fca2..61417df 100755
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test
@@ -75,10 +75,10 @@ where i_category in ('Music'))
,total_sales
limit 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=29.38MB Threads=6
+Max Per-Host Resource Reservation: Memory=28.44MB Threads=6
Per-Host Resource Estimates: Memory=362MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=361.81MB mem-reservation=29.38MB thread-reservation=6 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=361.81MB mem-reservation=28.44MB thread-reservation=6 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: i_item_id, sum(total_sales)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -231,7 +231,7 @@ PLAN-ROOT SINK
| | hash predicates: i_item_sk = cs_item_sk
| | fk/pk conjuncts: i_item_sk = cs_item_sk
| | runtime filters: RF011[min_max] <- cs_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=11,8,9,10 row-size=76B cardinality=14.35K
| | in pipelines: 14(GETNEXT), 11(OPEN)
| |
@@ -330,7 +330,7 @@ PLAN-ROOT SINK
| hash predicates: ss_item_sk = i_item_sk
| fk/pk conjuncts: ss_item_sk = i_item_sk
| runtime filters: RF003[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1,2,3 row-size=76B cardinality=27.62K
| in pipelines: 01(GETNEXT), 04(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test
index c6a6595..e0ab2ad 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test
@@ -47,10 +47,10 @@ ORDER BY promotions,
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=52.50MB Threads=14
-Per-Host Resource Estimates: Memory=604MB
+Max Per-Host Resource Reservation: Memory=45.00MB Threads=14
+Per-Host Resource Estimates: Memory=597MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=604.44MB mem-reservation=52.50MB thread-reservation=14 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=596.94MB mem-reservation=45.00MB thread-reservation=14 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -97,7 +97,7 @@ PLAN-ROOT SINK
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF014[bloom] <- c_customer_sk, RF015[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.02K
| | in pipelines: 14(GETNEXT), 17(OPEN)
| |
@@ -218,7 +218,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.91K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test
index f562abc..3aa37d1 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test
@@ -144,14 +144,14 @@ PLAN-ROOT SINK
| fk/pk conjuncts: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
| other predicates: count(*) <= count(*)
| runtime filters: RF003[min_max] <- i_item_sk, RF004[min_max] <- s_store_name, RF005[min_max] <- s_zip
-| mem-estimate=86.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=84.70MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=21,44 row-size=573B cardinality=288.12K
| in pipelines: 38(GETNEXT), 77(OPEN)
|
|--77:AGGREGATE [FINALIZE]
| | output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
| | group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
-| | mem-estimate=83.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=81.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=44 row-size=286B cardinality=288.12K
| | in pipelines: 77(GETNEXT), 56(OPEN)
| |
@@ -518,7 +518,7 @@ PLAN-ROOT SINK
38:AGGREGATE [FINALIZE]
| output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
| group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
-| mem-estimate=83.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=81.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=21 row-size=286B cardinality=288.12K
| in pipelines: 38(GETNEXT), 17(OPEN)
|
@@ -884,8 +884,8 @@ PLAN-ROOT SINK
tuple-ids=17 row-size=78B cardinality=50.00K
in pipelines: 17(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=532.89MB Threads=98
-Per-Host Resource Estimates: Memory=2.84GB
+Max Per-Host Resource Reservation: Memory=521.64MB Threads=98
+Per-Host Resource Estimates: Memory=2.83GB
F59:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=121.76MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1258,7 +1258,7 @@ Per-Host Resources: mem-estimate=75.11MB mem-reservation=46.00MB thread-reservat
| | in pipelines: 39(GETNEXT)
| |
| F38:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=10.22MB mem-reservation=6.69MB thread-reservation=1
+| Per-Host Resources: mem-estimate=8.35MB mem-reservation=4.81MB thread-reservation=1
| 67:HASH JOIN [INNER JOIN, BROADCAST]
| | hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
| | fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
@@ -1289,7 +1289,7 @@ Per-Host Resources: mem-estimate=75.11MB mem-reservation=46.00MB thread-reservat
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF067[min_max] <- c_customer_sk
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=23,43,29,24,37,36,32,33 row-size=213B cardinality=8.66K
| | in pipelines: 39(GETNEXT), 49(OPEN)
| |
@@ -1317,7 +1317,7 @@ Per-Host Resources: mem-estimate=75.11MB mem-reservation=46.00MB thread-reservat
| | in pipelines: 39(GETNEXT)
| |
| F33:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=19.69MB mem-reservation=14.31MB thread-reservation=1
+| Per-Host Resources: mem-estimate=15.94MB mem-reservation=10.56MB thread-reservation=1
| 65:HASH JOIN [INNER JOIN, BROADCAST]
| | hash predicates: ss_store_sk = s_store_sk
| | fk/pk conjuncts: ss_store_sk = s_store_sk
@@ -1398,7 +1398,7 @@ Per-Host Resources: mem-estimate=75.11MB mem-reservation=46.00MB thread-reservat
| | hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| | fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| | runtime filters: RF076[min_max] <- sr_item_sk, RF077[min_max] <- sr_ticket_number
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=23,43,29,24 row-size=139B cardinality=8.93K
| | in pipelines: 39(GETNEXT), 40(OPEN)
| |
@@ -1840,7 +1840,7 @@ Per-Host Resources: mem-estimate=3.85MB mem-reservation=1.94MB thread-reservatio
| in pipelines: 00(GETNEXT)
|
F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=10.22MB mem-reservation=6.69MB thread-reservation=1
+Per-Host Resources: mem-estimate=8.35MB mem-reservation=4.81MB thread-reservation=1
28:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
| fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
@@ -1871,7 +1871,7 @@ Per-Host Resources: mem-estimate=10.22MB mem-reservation=6.69MB thread-reservati
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF027[min_max] <- c_customer_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,20,6,1,14,13,9,10 row-size=213B cardinality=8.66K
| in pipelines: 00(GETNEXT), 10(OPEN)
|
@@ -1899,7 +1899,7 @@ Per-Host Resources: mem-estimate=10.22MB mem-reservation=6.69MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=21.69MB mem-reservation=16.31MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=17.94MB mem-reservation=12.56MB thread-reservation=1 runtime-filters-memory=2.00MB
26:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: ss_store_sk = s_store_sk
| fk/pk conjuncts: ss_store_sk = s_store_sk
@@ -1981,7 +1981,7 @@ Per-Host Resources: mem-estimate=21.69MB mem-reservation=16.31MB thread-reservat
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| runtime filters: RF034[bloom] <- sr_item_sk, RF035[bloom] <- sr_ticket_number, RF036[min_max] <- sr_item_sk, RF037[min_max] <- sr_ticket_number
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,20,6,1 row-size=139B cardinality=8.93K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -2079,8 +2079,8 @@ Per-Host Resources: mem-estimate=135.93MB mem-reservation=15.88MB thread-reserva
tuple-ids=0 row-size=56B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=638.52MB Threads=135
-Per-Host Resource Estimates: Memory=1.70GB
+Max Per-Host Resource Reservation: Memory=627.27MB Threads=135
+Per-Host Resource Estimates: Memory=1.69GB
F59:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=123.00MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -2581,17 +2581,17 @@ Per-Instance Resources: mem-estimate=26.83MB mem-reservation=12.00MB thread-rese
| | hash-table-id=12
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=23,43,29,24,37,36,32,33 row-size=213B cardinality=8.66K
| | in pipelines: 39(GETNEXT), 49(OPEN)
| |
| |--F72:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
-| | | Per-Instance Resources: mem-estimate=5.19MB mem-reservation=2.88MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=4.25MB mem-reservation=1.94MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=12 plan-id=13 cohort-id=02
| | | build expressions: c_customer_sk
| | | runtime filters: RF067[min_max] <- c_customer_sk
-| | | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 118:EXCHANGE [HASH(c_customer_sk)]
| | | mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
@@ -2722,17 +2722,17 @@ Per-Instance Resources: mem-estimate=26.83MB mem-reservation=12.00MB thread-rese
| | hash-table-id=16
| | hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| | fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-| | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=23,43,29,24 row-size=139B cardinality=8.93K
| | in pipelines: 39(GETNEXT), 40(OPEN)
| |
| |--F76:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
-| | | Per-Instance Resources: mem-estimate=9.16MB mem-reservation=4.75MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=7.28MB mem-reservation=2.88MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=16 plan-id=17 cohort-id=02
| | | build expressions: sr_item_sk, sr_ticket_number
| | | runtime filters: RF076[min_max] <- sr_item_sk, RF077[min_max] <- sr_ticket_number
-| | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | |
| | 113:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
| | | mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
@@ -2834,10 +2834,10 @@ Per-Instance Resources: mem-estimate=26.83MB mem-reservation=12.00MB thread-rese
| | in pipelines: 59(GETNEXT)
| |
| 39:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
-| HDFS partitions=1824/1824 files=1824 size=200.96MB
+| HDFS partitions=1824/1824 files=1824 size=200.97MB
| runtime filters: RF081[min_max] -> ss_item_sk, RF076[min_max] -> ss_item_sk, RF077[min_max] -> ss_ticket_number, RF073[min_max] -> ss_hdemo_sk, RF071[min_max] -> ss_promo_sk, RF055[min_max] -> ss_addr_sk, RF059[min_max] -> ss_cdemo_sk, RF067[min_max] -> ss_customer_sk, RF069[min_max] -> ss_store_sk, RF047[min_max] -> ss_item_sk, RF080[bloom] -> ss_item_sk, RF078[bloom] -> ss_sold_date_sk
| stored statistics:
-| table: rows=2.88M size=200.96MB
+| table: rows=2.88M size=200.97MB
| partitions: 1824/1824 rows=2.88M
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=130.09K
@@ -3309,17 +3309,17 @@ Per-Instance Resources: mem-estimate=1.79MB mem-reservation=0B thread-reservatio
| hash-table-id=30
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,20,6,1,14,13,9,10 row-size=213B cardinality=8.66K
| in pipelines: 00(GETNEXT), 10(OPEN)
|
|--F90:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=5.19MB mem-reservation=2.88MB thread-reservation=1
+| | Per-Instance Resources: mem-estimate=4.25MB mem-reservation=1.94MB thread-reservation=1
| JOIN BUILD
| | join-table-id=30 plan-id=31 cohort-id=01
| | build expressions: c_customer_sk
| | runtime filters: RF027[min_max] <- c_customer_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| |
| 88:EXCHANGE [HASH(c_customer_sk)]
| | mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
@@ -3451,17 +3451,17 @@ Per-Instance Resources: mem-estimate=1.27MB mem-reservation=0B thread-reservatio
| hash-table-id=34
| hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
| fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,20,6,1 row-size=139B cardinality=8.93K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F94:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
-| | Per-Instance Resources: mem-estimate=11.16MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+| | Per-Instance Resources: mem-estimate=9.28MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
| JOIN BUILD
| | join-table-id=34 plan-id=35 cohort-id=01
| | build expressions: sr_item_sk, sr_ticket_number
| | runtime filters: RF034[bloom] <- sr_item_sk, RF035[bloom] <- sr_ticket_number, RF036[min_max] <- sr_item_sk, RF037[min_max] <- sr_ticket_number
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| |
| 83:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
| | mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test
index 176d207..d9dd137 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test
@@ -40,10 +40,10 @@ from
and d_moy = 11) all_sales
order by promotions, total
---- PLAN
-Max Per-Host Resource Reservation: Memory=52.50MB Threads=14
-Per-Host Resource Estimates: Memory=604MB
+Max Per-Host Resource Reservation: Memory=45.00MB Threads=14
+Per-Host Resource Estimates: Memory=597MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=604.44MB mem-reservation=52.50MB thread-reservation=14 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=596.94MB mem-reservation=45.00MB thread-reservation=14 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -90,7 +90,7 @@ PLAN-ROOT SINK
| | hash predicates: ss_customer_sk = c_customer_sk
| | fk/pk conjuncts: ss_customer_sk = c_customer_sk
| | runtime filters: RF014[bloom] <- c_customer_sk, RF015[min_max] <- c_customer_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.02K
| | in pipelines: 14(GETNEXT), 17(OPEN)
| |
@@ -211,7 +211,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.91K
| in pipelines: 00(GETNEXT), 04(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test
index b7d9c74..fbb83d4 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test
@@ -42,9 +42,9 @@ order by i_category
limit 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=251.75MB Threads=5
-Per-Host Resource Estimates: Memory=17.19GB
+Per-Host Resource Estimates: Memory=17.08GB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=17.19GB mem-reservation=251.75MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=17.08GB mem-reservation=251.75MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id, sumsales, rk
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -81,7 +81,7 @@ PLAN-ROOT SINK
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT), CAST(7 AS INT), CAST(8 AS INT), CAST(9 AS INT), CAST(10 AS INT), CAST(11 AS INT), CAST(12 AS INT)), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(5 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(6 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(7 AS INT) THEN sum(coalesce( [...]
| group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN i_category WHEN CAST(8 AS INT) THEN i_category WHEN CAST(9 AS INT) THEN i_category WHEN CAST(10 AS INT) THEN i_category WHEN CAST(11 AS INT) THEN i_category WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN i_class WHEN CAST(6 A [...]
-| mem-estimate=1.52GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=1.46GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=92B cardinality=15.09M
| in pipelines: 08(GETNEXT), 07(OPEN)
|
@@ -113,7 +113,7 @@ PLAN-ROOT SINK
| Class 8
| output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
| group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-| mem-estimate=15.67GB mem-reservation=210.75MB thread-reservation=0
+| mem-estimate=15.61GB mem-reservation=210.75MB thread-reservation=0
| tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
| in pipelines: 07(GETNEXT), 00(OPEN)
|
@@ -187,7 +187,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=478.39MB Threads=11
-Per-Host Resource Estimates: Memory=32.05GB
+Per-Host Resource Estimates: Memory=31.92GB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -237,7 +237,7 @@ Per-Host Resources: mem-estimate=4.08MB mem-reservation=4.00MB thread-reservatio
| in pipelines: 09(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(i_category) WHEN 7 THEN murmur_hash(i_category) WHEN 8 THEN murmur_hash(i_category) WHEN 9 THEN murmur_hash(i_category) WHEN 10 THEN murmur_hash(i_category) WHEN 11 THEN murmur_hash(i_category) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(i_class) WHE [...]
-Per-Host Resources: mem-estimate=27.31GB mem-reservation=244.75MB thread-reservation=1
+Per-Host Resources: mem-estimate=27.19GB mem-reservation=244.75MB thread-reservation=1
09:TOP-N
| order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quan [...]
| limit with ties: 200
@@ -249,7 +249,7 @@ Per-Host Resources: mem-estimate=27.31GB mem-reservation=244.75MB thread-reserva
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT), CAST(7 AS INT), CAST(8 AS INT), CAST(9 AS INT), CAST(10 AS INT), CAST(11 AS INT), CAST(12 AS INT)), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(5 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(6 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(7 AS INT) THEN sum(coalesce( [...]
| group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN i_category WHEN CAST(8 AS INT) THEN i_category WHEN CAST(9 AS INT) THEN i_category WHEN CAST(10 AS INT) THEN i_category WHEN CAST(11 AS INT) THEN i_category WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN i_class WHEN CAST(6 A [...]
-| mem-estimate=517.97MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=498.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=92B cardinality=15.09M
| in pipelines: 08(GETNEXT), 17(OPEN)
|
@@ -281,7 +281,7 @@ Per-Host Resources: mem-estimate=27.31GB mem-reservation=244.75MB thread-reserva
| Class 8
| output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
| group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-| mem-estimate=26.80GB mem-reservation=210.75MB thread-reservation=0
+| mem-estimate=26.71GB mem-reservation=210.75MB thread-reservation=0
| tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
| in pipelines: 17(GETNEXT), 00(OPEN)
|
@@ -291,7 +291,7 @@ Per-Host Resources: mem-estimate=27.31GB mem-reservation=244.75MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=4.55GB mem-reservation=223.62MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=4.53GB mem-reservation=223.62MB thread-reservation=2 runtime-filters-memory=3.00MB
07:AGGREGATE [STREAMING]
| Class 0
| output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
@@ -320,7 +320,7 @@ Per-Host Resources: mem-estimate=4.55GB mem-reservation=223.62MB thread-reservat
| Class 8
| output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
| group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-| mem-estimate=4.47GB mem-reservation=211.00MB thread-reservation=0
+| mem-estimate=4.45GB mem-reservation=211.00MB thread-reservation=0
| tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
| in pipelines: 00(GETNEXT)
|
@@ -415,7 +415,7 @@ Per-Host Resources: mem-estimate=4.55GB mem-reservation=223.62MB thread-reservat
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=950.77MB Threads=13
-Per-Host Resource Estimates: Memory=32.70GB
+Per-Host Resource Estimates: Memory=32.56GB
F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.06MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -465,7 +465,7 @@ Per-Instance Resources: mem-estimate=4.13MB mem-reservation=4.00MB thread-reserv
| in pipelines: 09(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(i_category) WHEN 7 THEN murmur_hash(i_category) WHEN 8 THEN murmur_hash(i_category) WHEN 9 THEN murmur_hash(i_category) WHEN 10 THEN murmur_hash(i_category) WHEN 11 THEN murmur_hash(i_category) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(i_class) WHE [...]
-Per-Instance Resources: mem-estimate=14.02GB mem-reservation=244.75MB thread-reservation=1
+Per-Instance Resources: mem-estimate=13.96GB mem-reservation=244.75MB thread-reservation=1
09:TOP-N
| order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quan [...]
| limit with ties: 200
@@ -477,7 +477,7 @@ Per-Instance Resources: mem-estimate=14.02GB mem-reservation=244.75MB thread-res
08:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT), CAST(7 AS INT), CAST(8 AS INT), CAST(9 AS INT), CAST(10 AS INT), CAST(11 AS INT), CAST(12 AS INT)), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(5 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(6 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(7 AS INT) THEN sum(coalesce( [...]
| group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN i_category WHEN CAST(8 AS INT) THEN i_category WHEN CAST(9 AS INT) THEN i_category WHEN CAST(10 AS INT) THEN i_category WHEN CAST(11 AS INT) THEN i_category WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN i_class WHEN CAST(6 A [...]
-| mem-estimate=258.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=249.40MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=92B cardinality=15.09M
| in pipelines: 08(GETNEXT), 17(OPEN)
|
@@ -509,7 +509,7 @@ Per-Instance Resources: mem-estimate=14.02GB mem-reservation=244.75MB thread-res
| Class 8
| output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
| group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-| mem-estimate=13.77GB mem-reservation=210.75MB thread-reservation=0
+| mem-estimate=13.72GB mem-reservation=210.75MB thread-reservation=0
| tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
| in pipelines: 17(GETNEXT), 00(OPEN)
|
@@ -549,7 +549,7 @@ Per-Instance Resources: mem-estimate=2.28GB mem-reservation=212.00MB thread-rese
| Class 8
| output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
| group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-| mem-estimate=2.27GB mem-reservation=211.00MB thread-reservation=0
+| mem-estimate=2.26GB mem-reservation=211.00MB thread-reservation=0
| tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test
index 7e6c071..e3662e3 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test
@@ -48,10 +48,10 @@ order by
ss_ticket_number
limit 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=78.81MB Threads=8
-Per-Host Resource Estimates: Memory=406MB
+Max Per-Host Resource Reservation: Memory=70.31MB Threads=8
+Per-Host Resource Estimates: Memory=398MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=406.31MB mem-reservation=78.81MB thread-reservation=8 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=397.81MB mem-reservation=70.31MB thread-reservation=8 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -85,7 +85,7 @@ PLAN-ROOT SINK
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=5,7 row-size=129B cardinality=702.92K
| in pipelines: 09(GETNEXT), 10(OPEN)
|
@@ -103,7 +103,7 @@ PLAN-ROOT SINK
09:AGGREGATE [FINALIZE]
| output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
| group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-| mem-estimate=67.67MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=64.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=5 row-size=85B cardinality=702.92K
| in pipelines: 09(GETNEXT), 00(OPEN)
|
@@ -198,8 +198,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=40B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=120.39MB Threads=16
-Per-Host Resource Estimates: Memory=498MB
+Max Per-Host Resource Reservation: Memory=111.89MB Threads=16
+Per-Host Resource Estimates: Memory=489MB
F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -214,7 +214,7 @@ PLAN-ROOT SINK
| in pipelines: 14(GETNEXT)
|
F05:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=73.47MB mem-reservation=57.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=64.97MB mem-reservation=49.25MB thread-reservation=1 runtime-filters-memory=2.00MB
14:TOP-N [LIMIT=100]
| order by: c_last_name ASC, ss_ticket_number ASC
| mem-estimate=13.07KB mem-reservation=0B thread-reservation=0
@@ -251,7 +251,7 @@ Per-Host Resources: mem-estimate=73.47MB mem-reservation=57.75MB thread-reservat
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
| runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| tuple-ids=5,7 row-size=129B cardinality=702.92K
| in pipelines: 20(GETNEXT), 10(OPEN)
|
@@ -413,8 +413,8 @@ Per-Host Resources: mem-estimate=179.04MB mem-reservation=53.56MB thread-reserva
tuple-ids=0 row-size=40B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=160.70MB Threads=17
-Per-Host Resource Estimates: Memory=305MB
+Max Per-Host Resource Reservation: Memory=143.70MB Threads=17
+Per-Host Resource Estimates: Memory=288MB
F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.08MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -474,17 +474,17 @@ Per-Instance Resources: mem-estimate=27.52MB mem-reservation=17.00MB thread-rese
| hash-table-id=01
| hash predicates: ss_customer_sk = c_customer_sk
| fk/pk conjuncts: ss_customer_sk = c_customer_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
| tuple-ids=5,7 row-size=129B cardinality=702.92K
| in pipelines: 20(GETNEXT), 10(OPEN)
|
|--F10:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=39.24MB mem-reservation=35.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=22.24MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=01 plan-id=02 cohort-id=01
| | build expressions: c_customer_sk
| | runtime filters: RF002[bloom] <- c_customer_sk, RF003[min_max] <- c_customer_sk
-| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB thread-reservation=0
+| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
| |
| 21:EXCHANGE [BROADCAST]
| | mem-estimate=4.24MB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test
index 9eebb74..c1a4a11 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test
@@ -39,9 +39,9 @@ ORDER BY total_cnt DESC,
LIMIT 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=157.50MB Threads=12
-Per-Host Resource Estimates: Memory=1.00GB
+Per-Host Resource Estimates: Memory=1008MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=1.00GB mem-reservation=157.50MB thread-reservation=12 runtime-filters-memory=9.00MB
+| Per-Host Resources: mem-estimate=1008.49MB mem-reservation=157.50MB thread-reservation=12 runtime-filters-memory=9.00MB
PLAN-ROOT SINK
| output exprs: i_item_desc, w_warehouse_name, d1.d_week_seq, sum(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count(*)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -55,7 +55,7 @@ PLAN-ROOT SINK
21:AGGREGATE [FINALIZE]
| output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
| group by: i_item_desc, w_warehouse_name, d1.d_week_seq
-| mem-estimate=234.36MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=229.31MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=11 row-size=170B cardinality=1.32M
| in pipelines: 21(GETNEXT), 01(OPEN)
|
@@ -159,7 +159,7 @@ PLAN-ROOT SINK
| fk/pk conjuncts: none
| other predicates: inv_quantity_on_hand < cs_quantity
| runtime filters: RF006[bloom] <- cs_sold_date_sk, RF007[bloom] <- cs_item_sk, RF008[min_max] <- cs_sold_date_sk, RF009[min_max] <- cs_item_sk
-| mem-estimate=118.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=102.99MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=1,2,3,7,6,0 row-size=256B cardinality=8.12M
| in pipelines: 01(GETNEXT), 00(OPEN)
|
@@ -279,7 +279,7 @@ PLAN-ROOT SINK
| in pipelines: 22(GETNEXT)
|
F12:PLAN FRAGMENT [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=86.95MB mem-reservation=34.00MB thread-reservation=1
22:TOP-N [LIMIT=100]
| order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
| mem-estimate=16.60KB mem-reservation=0B thread-reservation=0
@@ -289,7 +289,7 @@ Per-Host Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-reservat
35:AGGREGATE [FINALIZE]
| output: sum:merge(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count:merge(*)
| group by: i_item_desc, w_warehouse_name, d1.d_week_seq
-| mem-estimate=78.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=76.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=11 row-size=170B cardinality=1.32M
| in pipelines: 35(GETNEXT), 00(OPEN)
|
@@ -299,11 +299,11 @@ Per-Host Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F06:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=179.68MB mem-reservation=124.12MB thread-reservation=1 runtime-filters-memory=5.00MB
+Per-Host Resources: mem-estimate=178.42MB mem-reservation=124.12MB thread-reservation=1 runtime-filters-memory=5.00MB
21:AGGREGATE [STREAMING]
| output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
| group by: i_item_desc, w_warehouse_name, d1.d_week_seq
-| mem-estimate=58.59MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=57.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=11 row-size=170B cardinality=1.32M
| in pipelines: 00(GETNEXT)
|
@@ -587,7 +587,7 @@ Per-Host Resources: mem-estimate=389.00MB mem-reservation=21.00MB thread-reserva
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=300.61MB Threads=24
-Per-Host Resource Estimates: Memory=598MB
+Per-Host Resource Estimates: Memory=595MB
F13:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.06MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -602,7 +602,7 @@ PLAN-ROOT SINK
| in pipelines: 22(GETNEXT)
|
F12:PLAN FRAGMENT [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=86.95MB mem-reservation=34.00MB thread-reservation=1
22:TOP-N [LIMIT=100]
| order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
| mem-estimate=16.60KB mem-reservation=0B thread-reservation=0
@@ -612,7 +612,7 @@ Per-Instance Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-rese
35:AGGREGATE [FINALIZE]
| output: sum:merge(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count:merge(*)
| group by: i_item_desc, w_warehouse_name, d1.d_week_seq
-| mem-estimate=78.12MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=76.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=11 row-size=170B cardinality=1.32M
| in pipelines: 35(GETNEXT), 00(OPEN)
|
@@ -622,11 +622,11 @@ Per-Instance Resources: mem-estimate=88.63MB mem-reservation=34.00MB thread-rese
| in pipelines: 00(GETNEXT)
|
F06:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=3 instances=3
-Per-Instance Resources: mem-estimate=68.72MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=67.46MB mem-reservation=34.00MB thread-reservation=1
21:AGGREGATE [STREAMING]
| output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
| group by: i_item_desc, w_warehouse_name, d1.d_week_seq
-| mem-estimate=58.59MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=57.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=11 row-size=170B cardinality=1.32M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test
index 3663d1c..d4ceb8a 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test
@@ -37,10 +37,10 @@ order by
cnt desc
limit 1000
---- PLAN
-Max Per-Host Resource Reservation: Memory=24.12MB Threads=6
-Per-Host Resource Estimates: Memory=269MB
+Max Per-Host Resource Reservation: Memory=22.25MB Threads=6
+Per-Host Resource Estimates: Memory=267MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=268.62MB mem-reservation=24.12MB thread-reservation=6 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=266.75MB mem-reservation=22.25MB thread-reservation=6 runtime-filters-memory=4.00MB
PLAN-ROOT SINK
| output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -92,7 +92,7 @@ PLAN-ROOT SINK
| | hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
| | fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
| | runtime filters: RF004[bloom] <- date_dim.d_date_sk
-| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| | tuple-ids=0,3,1 row-size=60B cardinality=162.45K
| | in pipelines: 00(GETNEXT), 01(OPEN)
| |
@@ -150,8 +150,8 @@ PLAN-ROOT SINK
tuple-ids=6 row-size=68B cardinality=100.00K
in pipelines: 08(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=31.83MB Threads=13
-Per-Host Resource Estimates: Memory=307MB
+Max Per-Host Resource Reservation: Memory=29.95MB Threads=13
+Per-Host Resource Estimates: Memory=305MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.27MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -219,7 +219,7 @@ Per-Host Resources: mem-estimate=11.10MB mem-reservation=2.88MB thread-reservati
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=86.95MB mem-reservation=17.62MB thread-reservation=2 runtime-filters-memory=4.00MB
+Per-Host Resources: mem-estimate=85.08MB mem-reservation=15.75MB thread-reservation=2 runtime-filters-memory=4.00MB
07:AGGREGATE [STREAMING]
| output: count(*)
| group by: ss_ticket_number, ss_customer_sk
@@ -259,7 +259,7 @@ Per-Host Resources: mem-estimate=86.95MB mem-reservation=17.62MB thread-reservat
| hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
| fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
| runtime filters: RF004[bloom] <- date_dim.d_date_sk
-| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=60B cardinality=162.45K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -320,8 +320,8 @@ Per-Host Resources: mem-estimate=86.95MB mem-reservation=17.62MB thread-reservat
tuple-ids=0 row-size=24B cardinality=2.88M
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=49.45MB Threads=16
-Per-Host Resource Estimates: Memory=189MB
+Max Per-Host Resource Reservation: Memory=45.70MB Threads=16
+Per-Host Resource Estimates: Memory=185MB
F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.51MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -446,17 +446,17 @@ Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reser
| hash-table-id=02
| hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
| fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
| tuple-ids=0,3,1 row-size=60B cardinality=162.45K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=10.79MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=7.04MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=02 plan-id=03 cohort-id=01
| | build expressions: date_dim.d_date_sk
| | runtime filters: RF004[bloom] <- date_dim.d_date_sk
-| | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
| |
| 12:EXCHANGE [BROADCAST]
| | mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test
index f159253..1c8001d 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test
@@ -65,10 +65,10 @@ ORDER BY 1
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=222.25MB Threads=13
-Per-Host Resource Estimates: Memory=720MB
+Max Per-Host Resource Reservation: Memory=200.56MB Threads=13
+Per-Host Resource Estimates: Memory=715MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=720.12MB mem-reservation=222.25MB thread-reservation=13 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=715.44MB mem-reservation=200.56MB thread-reservation=13 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: customer_id, customer_first_name, customer_last_name
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -104,7 +104,7 @@ PLAN-ROOT SINK
| | hash predicates: c_customer_sk = ws_bill_customer_sk
| | fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
| | runtime filters: RF019[min_max] <- ws_bill_customer_sk
-| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| | tuple-ids=34,35,36 row-size=88B cardinality=148.00K
| | in pipelines: 22(GETNEXT), 23(OPEN)
| |
@@ -155,7 +155,7 @@ PLAN-ROOT SINK
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF002[bloom] <- customer_id, RF003[min_max] <- customer_id
-| mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| tuple-ids=18,28,8 row-size=168B cardinality=43.59K
| in pipelines: 13(GETNEXT), 06(OPEN)
|
@@ -168,7 +168,7 @@ PLAN-ROOT SINK
| | output: sum(ss_net_paid)
| | group by: c_customer_id, c_first_name, c_last_name, d_year
| | having: sum(ss_net_paid) > CAST(0 AS DECIMAL(3,0))
-| | mem-estimate=56.15MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=53.91MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=3 row-size=84B cardinality=58.90K
| | in pipelines: 06(GETNEXT), 02(OPEN)
| |
@@ -228,7 +228,7 @@ PLAN-ROOT SINK
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=124B cardinality=43.59K
| in pipelines: 13(GETNEXT), 20(OPEN)
|
@@ -249,7 +249,7 @@ PLAN-ROOT SINK
| | hash predicates: c_customer_sk = ws_bill_customer_sk
| | fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
| | runtime filters: RF010[bloom] <- ws_bill_customer_sk, RF011[min_max] <- ws_bill_customer_sk
-| | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
| | tuple-ids=24,25,26 row-size=88B cardinality=148.00K
| | in pipelines: 15(GETNEXT), 16(OPEN)
| |
@@ -304,7 +304,7 @@ PLAN-ROOT SINK
13:AGGREGATE [FINALIZE]
| output: sum(ss_net_paid)
| group by: c_customer_id, c_first_name, c_last_name, d_year
-| mem-estimate=56.15MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=53.91MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=13 row-size=84B cardinality=589.03K
| in pipelines: 13(GETNEXT), 09(OPEN)
|
@@ -360,8 +360,8 @@ PLAN-ROOT SINK
tuple-ids=11 row-size=12B cardinality=2.88M
in pipelines: 09(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=240.75MB Threads=34
-Per-Host Resource Estimates: Memory=926MB
+Max Per-Host Resource Reservation: Memory=239.81MB Threads=34
+Per-Host Resource Estimates: Memory=925MB
F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -617,12 +617,12 @@ Per-Host Resources: mem-estimate=15.89MB mem-reservation=9.62MB thread-reservati
| in pipelines: 36(GETNEXT)
|
F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=48.85MB mem-reservation=37.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=47.91MB mem-reservation=36.94MB thread-reservation=1 runtime-filters-memory=1.00MB
28:HASH JOIN [INNER JOIN, BROADCAST]
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
| runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=124B cardinality=43.59K
| in pipelines: 36(GETNEXT), 41(OPEN)
|
@@ -831,8 +831,8 @@ Per-Host Resources: mem-estimate=35.95MB mem-reservation=4.94MB thread-reservati
tuple-ids=11 row-size=12B cardinality=2.88M
in pipelines: 09(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=267.38MB Threads=44
-Per-Host Resource Estimates: Memory=621MB
+Max Per-Host Resource Reservation: Memory=265.50MB Threads=44
+Per-Host Resource Estimates: Memory=619MB
F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -1144,17 +1144,17 @@ Per-Instance Resources: mem-estimate=27.52MB mem-reservation=17.00MB thread-rese
| hash-table-id=06
| hash predicates: customer_id = customer_id
| fk/pk conjuncts: assumed fk/pk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=18,28 row-size=124B cardinality=43.59K
| in pipelines: 36(GETNEXT), 41(OPEN)
|
|--F32:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| | Per-Instance Resources: mem-estimate=7.46MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.59MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=06 plan-id=07 cohort-id=01
| | build expressions: customer_id
| | runtime filters: RF004[bloom] <- customer_id, RF005[min_max] <- customer_id
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 42:EXCHANGE [BROADCAST]
| | mem-estimate=731.94KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test
index 44c396d..85d356c 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test
@@ -112,7 +112,7 @@ PLAN-ROOT SINK
| | | output: sum(CAST(ss_quantity AS BIGINT)), sum(ss_wholesale_cost), sum(ss_sales_price)
| | | group by: d_year, ss_item_sk, ss_customer_sk
| | | having: d_year = CAST(2000 AS INT)
-| | | mem-estimate=40.45MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | | mem-estimate=38.20MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | | tuple-ids=3 row-size=56B cardinality=3.00K
| | | in pipelines: 05(GETNEXT), 00(OPEN)
| | |
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test
index 724d136..e2931ff 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test
@@ -110,7 +110,7 @@ PLAN-ROOT SINK
38:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(sales) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(`returns`) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) END), aggif(valid_tid(26,27 [...]
| group by: CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN channel WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN id WHEN CAST(27 AS INT) THEN NULL WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN CAST(26 AS INT) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) END
-| mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=29 row-size=76B cardinality=11.56K
| in pipelines: 38(GETNEXT), 37(OPEN)
|
@@ -253,7 +253,7 @@ PLAN-ROOT SINK
|--24:AGGREGATE [FINALIZE]
| | output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(cs_net_profit - coalesce(cr_net_loss, CAST(0 AS DECIMAL(7,2))))
| | group by: cp_catalog_page_id
-| | mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=14 row-size=76B cardinality=11.54K
| | in pipelines: 24(GETNEXT), 13(OPEN)
| |
@@ -485,7 +485,7 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 01(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=147.31MB Threads=39
+Max Per-Host Resource Reservation: Memory=146.31MB Threads=39
Per-Host Resource Estimates: Memory=1.45GB
F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
@@ -734,11 +734,11 @@ Per-Host Resources: mem-estimate=40.51MB mem-reservation=7.94MB thread-reservati
| | in pipelines: 13(GETNEXT)
| |
| F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-| Per-Host Resources: mem-estimate=370.23MB mem-reservation=39.25MB thread-reservation=2 runtime-filters-memory=4.00MB
+| Per-Host Resources: mem-estimate=370.23MB mem-reservation=38.25MB thread-reservation=2 runtime-filters-memory=4.00MB
| 24:AGGREGATE [STREAMING]
| | output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(cs_net_profit - coalesce(cr_net_loss, CAST(0 AS DECIMAL(7,2))))
| | group by: cp_catalog_page_id
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=14 row-size=76B cardinality=11.54K
| | in pipelines: 13(GETNEXT)
| |
@@ -1054,7 +1054,7 @@ Per-Host Resources: mem-estimate=141.64MB mem-reservation=34.75MB thread-reserva
tuple-ids=0 row-size=36B cardinality=2.88M
in pipelines: 01(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=232.50MB Threads=39
+Max Per-Host Resource Reservation: Memory=231.50MB Threads=39
Per-Host Resource Estimates: Memory=716MB
F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.05MB mem-reservation=4.00MB thread-reservation=1
@@ -1346,11 +1346,11 @@ Per-Instance Resources: mem-estimate=40.51MB mem-reservation=7.94MB thread-reser
| |
| F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
| Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
-| Per-Instance Resources: mem-estimate=58.00MB mem-reservation=19.00MB thread-reservation=1
+| Per-Instance Resources: mem-estimate=58.00MB mem-reservation=18.00MB thread-reservation=1
| 24:AGGREGATE [STREAMING]
| | output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(cs_net_profit - coalesce(cr_net_loss, CAST(0 AS DECIMAL(7,2))))
| | group by: cp_catalog_page_id
-| | mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=14 row-size=76B cardinality=11.54K
| | in pipelines: 13(GETNEXT)
| |
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test
index b906b00..5a286d6 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test
@@ -25,9 +25,9 @@ LIMIT 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=56.88MB Threads=5
-Per-Host Resource Estimates: Memory=283MB
+Per-Host Resource Estimates: Memory=278MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=282.83MB mem-reservation=56.88MB thread-reservation=5 runtime-filters-memory=3.00MB
+| Per-Host Resources: mem-estimate=278.34MB mem-reservation=56.88MB thread-reservation=5 runtime-filters-memory=3.00MB
PLAN-ROOT SINK
| output exprs: i_item_id, i_item_desc, i_current_price
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -40,7 +40,7 @@ PLAN-ROOT SINK
|
07:AGGREGATE [FINALIZE]
| group by: i_item_id, i_item_desc, i_current_price
-| mem-estimate=179.95MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=175.47MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=144B cardinality=1.18M
| in pipelines: 07(GETNEXT), 01(OPEN)
|
@@ -121,7 +121,7 @@ PLAN-ROOT SINK
in pipelines: 01(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=100.31MB Threads=10
-Per-Host Resource Estimates: Memory=406MB
+Per-Host Resource Estimates: Memory=402MB
F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -136,7 +136,7 @@ PLAN-ROOT SINK
| in pipelines: 08(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=2 instances=2
-Per-Host Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=98.02MB mem-reservation=34.00MB thread-reservation=1
08:TOP-N [LIMIT=100]
| order by: i_item_id ASC
| mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
@@ -145,7 +145,7 @@ Per-Host Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-reserva
|
13:AGGREGATE [FINALIZE]
| group by: i_item_id, i_item_desc, i_current_price
-| mem-estimate=89.98MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=87.73MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=144B cardinality=1.18M
| in pipelines: 13(GETNEXT), 01(OPEN)
|
@@ -155,10 +155,10 @@ Per-Host Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-reserva
| in pipelines: 01(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-Per-Host Resources: mem-estimate=170.67MB mem-reservation=55.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=168.99MB mem-reservation=55.88MB thread-reservation=2 runtime-filters-memory=2.00MB
07:AGGREGATE [STREAMING]
| group by: i_item_id, i_item_desc, i_current_price
-| mem-estimate=67.48MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=65.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=144B cardinality=1.18M
| in pipelines: 01(GETNEXT)
|
@@ -260,7 +260,7 @@ Per-Host Resources: mem-estimate=170.67MB mem-reservation=55.88MB thread-reserva
in pipelines: 01(GETNEXT)
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=109.62MB Threads=10
-Per-Host Resource Estimates: Memory=287MB
+Per-Host Resource Estimates: Memory=283MB
F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -275,7 +275,7 @@ PLAN-ROOT SINK
| in pipelines: 08(GETNEXT)
|
F04:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=2 instances=2
-Per-Instance Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=98.02MB mem-reservation=34.00MB thread-reservation=1
08:TOP-N [LIMIT=100]
| order by: i_item_id ASC
| mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
@@ -284,7 +284,7 @@ Per-Instance Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-res
|
13:AGGREGATE [FINALIZE]
| group by: i_item_id, i_item_desc, i_current_price
-| mem-estimate=89.98MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=87.73MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=144B cardinality=1.18M
| in pipelines: 13(GETNEXT), 01(OPEN)
|
@@ -295,10 +295,10 @@ Per-Instance Resources: mem-estimate=100.27MB mem-reservation=34.00MB thread-res
|
F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
-Per-Instance Resources: mem-estimate=99.48MB mem-reservation=50.00MB thread-reservation=1
+Per-Instance Resources: mem-estimate=97.80MB mem-reservation=50.00MB thread-reservation=1
07:AGGREGATE [STREAMING]
| group by: i_item_id, i_item_desc, i_current_price
-| mem-estimate=67.48MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=65.80MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=144B cardinality=1.18M
| in pipelines: 01(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test
index c2ce7b2..b84ca5b 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test
@@ -71,10 +71,10 @@ ORDER BY sr_items.item_id ,
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=59.25MB Threads=16
-Per-Host Resource Estimates: Memory=618MB
+Max Per-Host Resource Reservation: Memory=52.69MB Threads=16
+Per-Host Resource Estimates: Memory=612MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=618.44MB mem-reservation=59.25MB thread-reservation=16 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=611.88MB mem-reservation=52.69MB thread-reservation=16 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: item_id, sr_item_qty, (CAST(sr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), cr_item_qty, (CAST(cr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), wr_item_qty, (CAST(wr_item_qty AS DECIMAL(19,0)) * [...]
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -161,7 +161,7 @@ PLAN-ROOT SINK
| | hash predicates: cr_item_sk = i_item_sk
| | fk/pk conjuncts: cr_item_sk = i_item_sk
| | runtime filters: RF025[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=144.07K
| | in pipelines: 10(GETNEXT), 11(OPEN)
| |
@@ -243,7 +243,7 @@ PLAN-ROOT SINK
| | hash predicates: wr_item_sk = i_item_sk
| | fk/pk conjuncts: wr_item_sk = i_item_sk
| | runtime filters: RF015[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=20,18,19 row-size=78B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 21(OPEN)
| |
@@ -262,7 +262,7 @@ PLAN-ROOT SINK
| | hash predicates: d_date_sk = wr_returned_date_sk
| | fk/pk conjuncts: none
| | runtime filters: RF016[bloom] <- wr_returned_date_sk, RF017[min_max] <- wr_returned_date_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=20,18 row-size=42B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 20(OPEN)
| |
@@ -356,7 +356,7 @@ PLAN-ROOT SINK
| hash predicates: sr_item_sk = i_item_sk
| fk/pk conjuncts: sr_item_sk = i_item_sk
| runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=287.51K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -382,8 +382,8 @@ PLAN-ROOT SINK
tuple-ids=0 row-size=16B cardinality=287.51K
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=84.94MB Threads=32
-Per-Host Resource Estimates: Memory=702MB
+Max Per-Host Resource Reservation: Memory=78.38MB Threads=32
+Per-Host Resource Estimates: Memory=695MB
F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -426,7 +426,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| | in pipelines: 10(GETNEXT)
| |
| F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=95.08MB mem-reservation=13.56MB thread-reservation=2 runtime-filters-memory=1.00MB
+| Per-Host Resources: mem-estimate=94.14MB mem-reservation=12.62MB thread-reservation=2 runtime-filters-memory=1.00MB
| 19:AGGREGATE [STREAMING]
| | output: sum(CAST(cr_return_quantity AS BIGINT))
| | group by: i_item_id
@@ -516,7 +516,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| | hash predicates: cr_item_sk = i_item_sk
| | fk/pk conjuncts: cr_item_sk = i_item_sk
| | runtime filters: RF025[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=144.07K
| | in pipelines: 10(GETNEXT), 11(OPEN)
| |
@@ -569,7 +569,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| | in pipelines: 22(GETNEXT)
| |
| F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=59.10MB mem-reservation=18.31MB thread-reservation=2 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=54.41MB mem-reservation=13.62MB thread-reservation=2 runtime-filters-memory=2.00MB
| 29:AGGREGATE [STREAMING]
| | output: sum(CAST(wr_return_quantity AS BIGINT))
| | group by: i_item_id
@@ -633,7 +633,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| | hash predicates: wr_item_sk = i_item_sk
| | fk/pk conjuncts: wr_item_sk = i_item_sk
| | runtime filters: RF015[min_max] <- i_item_sk
-| | mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=20,18,19 row-size=78B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 21(OPEN)
| |
@@ -659,7 +659,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| | hash predicates: d_date_sk = wr_returned_date_sk
| | fk/pk conjuncts: none
| | runtime filters: RF016[bloom] <- wr_returned_date_sk, RF017[min_max] <- wr_returned_date_sk
-| | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=20,18 row-size=42B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 20(OPEN)
| |
@@ -705,7 +705,7 @@ Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservat
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-Per-Host Resources: mem-estimate=97.08MB mem-reservation=16.56MB thread-reservation=2 runtime-filters-memory=3.00MB
+Per-Host Resources: mem-estimate=96.14MB mem-reservation=15.62MB thread-reservation=2 runtime-filters-memory=3.00MB
09:AGGREGATE [STREAMING]
| output: sum(CAST(sr_return_quantity AS BIGINT))
| group by: i_item_id
@@ -795,7 +795,7 @@ Per-Host Resources: mem-estimate=97.08MB mem-reservation=16.56MB thread-reservat
| hash predicates: sr_item_sk = i_item_sk
| fk/pk conjuncts: sr_item_sk = i_item_sk
| runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=287.51K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
@@ -828,8 +828,8 @@ Per-Host Resources: mem-estimate=97.08MB mem-reservation=16.56MB thread-reservat
tuple-ids=0 row-size=16B cardinality=287.51K
in pipelines: 00(GETNEXT)
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=130.19MB Threads=31
-Per-Host Resource Estimates: Memory=427MB
+Max Per-Host Resource Reservation: Memory=117.06MB Threads=31
+Per-Host Resource Estimates: Memory=414MB
F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -996,17 +996,17 @@ Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reser
| | hash-table-id=04
| | hash predicates: cr_item_sk = i_item_sk
| | fk/pk conjuncts: cr_item_sk = i_item_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=9,10 row-size=52B cardinality=144.07K
| | in pipelines: 10(GETNEXT), 11(OPEN)
| |
| |--F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| | | Per-Instance Resources: mem-estimate=6.41MB mem-reservation=5.75MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=04 plan-id=05 cohort-id=02
| | | build expressions: i_item_sk
| | | runtime filters: RF025[min_max] <- i_item_sk
-| | | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 45:EXCHANGE [BROADCAST]
| | | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -1147,17 +1147,17 @@ Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reser
| | hash-table-id=08
| | hash predicates: wr_item_sk = i_item_sk
| | fk/pk conjuncts: wr_item_sk = i_item_sk
-| | mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| | tuple-ids=20,18,19 row-size=78B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 21(OPEN)
| |
| |--F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| | | Per-Instance Resources: mem-estimate=6.41MB mem-reservation=5.75MB thread-reservation=1
+| | | Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
| | JOIN BUILD
| | | join-table-id=08 plan-id=09 cohort-id=04
| | | build expressions: i_item_sk
| | | runtime filters: RF015[min_max] <- i_item_sk
-| | | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| | |
| | 40:EXCHANGE [BROADCAST]
| | | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
@@ -1181,17 +1181,17 @@ Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reser
| | hash-table-id=09
| | hash predicates: d_date_sk = wr_returned_date_sk
| | fk/pk conjuncts: none
-| | mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+| | mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
| | tuple-ids=20,18 row-size=42B cardinality=71.76K
| | in pipelines: 22(GETNEXT), 20(OPEN)
| |
| |--F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| | | Per-Instance Resources: mem-estimate=19.11MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | | Per-Instance Resources: mem-estimate=11.61MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
| | JOIN BUILD
| | | join-table-id=09 plan-id=10 cohort-id=04
| | | build expressions: wr_returned_date_sk
| | | runtime filters: RF016[bloom] <- wr_returned_date_sk, RF017[min_max] <- wr_returned_date_sk
-| | | mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
| | |
| | 39:EXCHANGE [BROADCAST]
| | | mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
@@ -1352,17 +1352,17 @@ Per-Instance Resources: mem-estimate=34.00MB mem-reservation=4.00MB thread-reser
| hash-table-id=13
| hash predicates: sr_item_sk = i_item_sk
| fk/pk conjuncts: sr_item_sk = i_item_sk
-| mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=0,1 row-size=52B cardinality=287.51K
| in pipelines: 00(GETNEXT), 01(OPEN)
|
|--F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-| | Per-Instance Resources: mem-estimate=7.41MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+| | Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
| JOIN BUILD
| | join-table-id=13 plan-id=14 cohort-id=01
| | build expressions: i_item_sk
| | runtime filters: RF008[bloom] <- i_item_sk, RF009[min_max] <- i_item_sk
-| | mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+| | mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
| |
| 33:EXCHANGE [BROADCAST]
| | mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test
index 2115ca5..c38cd94 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test
@@ -58,10 +58,10 @@ ORDER BY SUBSTRING(r_reason_desc,1,20) ,
avg(wr_fee)
LIMIT 100;
---- PLAN
-Max Per-Host Resource Reservation: Memory=69.59MB Threads=9
-Per-Host Resource Estimates: Memory=609MB
+Max Per-Host Resource Reservation: Memory=65.84MB Threads=9
+Per-Host Resource Estimates: Memory=605MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=608.81MB mem-reservation=69.59MB thread-reservation=9 runtime-filters-memory=10.00MB
+| Per-Host Resources: mem-estimate=605.06MB mem-reservation=65.84MB thread-reservation=9 runtime-filters-memory=10.00MB
PLAN-ROOT SINK
| output exprs: substring(r_reason_desc, 1, 20), avg(ws_quantity), avg(wr_refunded_cash), avg(wr_fee)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -159,7 +159,7 @@ PLAN-ROOT SINK
| | | fk/pk conjuncts: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
| | | other predicates: cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR [...]
| | | runtime filters: RF014[bloom] <- ws_item_sk, RF015[bloom] <- ws_order_number, RF016[min_max] <- ws_item_sk, RF017[min_max] <- ws_order_number
-| | | mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+| | | mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
| | | tuple-ids=3,1,0 row-size=115B cardinality=7.72K
| | | in pipelines: 03(GETNEXT), 00(OPEN)
| | |
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
index 2cd7d49..162daee 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
@@ -31,9 +31,9 @@ FROM ((SELECT DISTINCT c_last_name,
AND d_month_seq BETWEEN 1200 AND 1200+11)) cool_cust;
---- PLAN
Max Per-Host Resource Reservation: Memory=186.94MB Threads=10
-Per-Host Resource Estimates: Memory=651MB
+Per-Host Resource Estimates: Memory=619MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=651.42MB mem-reservation=186.94MB thread-reservation=10 runtime-filters-memory=6.00MB
+| Per-Host Resources: mem-estimate=618.94MB mem-reservation=186.94MB thread-reservation=10 runtime-filters-memory=6.00MB
PLAN-ROOT SINK
| output exprs: count(*)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -46,13 +46,13 @@ PLAN-ROOT SINK
|
19:HASH JOIN [LEFT ANTI JOIN]
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-| mem-estimate=71.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=63.77MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 05(GETNEXT), 17(OPEN)
|
|--17:AGGREGATE [FINALIZE]
| | group by: c_last_name, c_first_name, d_date
-| | mem-estimate=50.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=48.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=13 row-size=58B cardinality=719.38K
| | in pipelines: 17(GETNEXT), 12(OPEN)
| |
@@ -108,13 +108,13 @@ PLAN-ROOT SINK
|
18:HASH JOIN [LEFT ANTI JOIN]
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-| mem-estimate=143.69MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=127.69MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 05(GETNEXT), 11(OPEN)
|
|--11:AGGREGATE [FINALIZE]
| | group by: c_last_name, c_first_name, d_date
-| | mem-estimate=101.68MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=96.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=8 row-size=58B cardinality=1.44M
| | in pipelines: 11(GETNEXT), 06(OPEN)
| |
@@ -170,7 +170,7 @@ PLAN-ROOT SINK
|
05:AGGREGATE [FINALIZE]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=203.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=192.19MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 05(GETNEXT), 00(OPEN)
|
@@ -226,7 +226,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=330.81MB Threads=22
-Per-Host Resource Estimates: Memory=905MB
+Per-Host Resource Estimates: Memory=893MB
F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -245,7 +245,7 @@ PLAN-ROOT SINK
| in pipelines: 20(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=180.11MB mem-reservation=102.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=171.11MB mem-reservation=102.00MB thread-reservation=1
20:AGGREGATE
| output: count(*)
| mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
@@ -350,7 +350,7 @@ Per-Host Resources: mem-estimate=180.11MB mem-reservation=102.00MB thread-reserv
|
18:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
| hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-| mem-estimate=47.90MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=42.56MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 24(GETNEXT), 28(OPEN)
|
@@ -446,7 +446,7 @@ Per-Host Resources: mem-estimate=180.11MB mem-reservation=102.00MB thread-reserv
|
24:AGGREGATE [FINALIZE]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=67.73MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=64.06MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 24(GETNEXT), 00(OPEN)
|
@@ -456,10 +456,10 @@ Per-Host Resources: mem-estimate=180.11MB mem-reservation=102.00MB thread-reserv
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=83.33MB mem-reservation=46.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=80.58MB mem-reservation=46.94MB thread-reservation=2 runtime-filters-memory=2.00MB
05:AGGREGATE [STREAMING]
| group by: c_last_name, c_first_name, d_date
-| mem-estimate=50.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=48.05MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=58B cardinality=2.88M
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
index 6bec622..3d23f1e 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
@@ -30,9 +30,9 @@ order by count(distinct ws_order_number)
limit 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=113.88MB Threads=10
-Per-Host Resource Estimates: Memory=689MB
+Per-Host Resource Estimates: Memory=663MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=689.22MB mem-reservation=113.88MB thread-reservation=10 runtime-filters-memory=8.00MB
+| Per-Host Resources: mem-estimate=663.16MB mem-reservation=113.88MB thread-reservation=10 runtime-filters-memory=8.00MB
PLAN-ROOT SINK
| output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -154,7 +154,7 @@ PLAN-ROOT SINK
| | fk/pk conjuncts: none
| | other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
| | runtime filters: RF008[bloom] <- ws2.ws_order_number, RF009[min_max] <- ws2.ws_order_number
-| | mem-estimate=55.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=42.30MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=4,5 row-size=24B cardinality=8.66M
| | in pipelines: 04(GETNEXT), 05(OPEN)
| |
@@ -210,7 +210,7 @@ PLAN-ROOT SINK
| fk/pk conjuncts: none
| other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
| runtime filters: RF004[bloom] <- ws2.ws_order_number, RF005[min_max] <- ws2.ws_order_number
-| mem-estimate=55.33MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=42.30MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=9,10 row-size=24B cardinality=8.66M
| in pipelines: 08(GETNEXT), 09(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
index a513301..609ce2c 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
@@ -36,9 +36,9 @@ LIMIT 100;
---- PLAN
Max Per-Host Resource Reservation: Memory=106.94MB Threads=5
-Per-Host Resource Estimates: Memory=297MB
+Per-Host Resource Estimates: Memory=282MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=297.28MB mem-reservation=106.94MB thread-reservation=5 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=281.80MB mem-reservation=106.94MB thread-reservation=5 runtime-filters-memory=2.00MB
PLAN-ROOT SINK
| output exprs: sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -53,13 +53,13 @@ PLAN-ROOT SINK
08:HASH JOIN [FULL OUTER JOIN]
| hash predicates: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
| fk/pk conjuncts: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
-| mem-estimate=80.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=64.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2N,6N row-size=24B cardinality=4.32M
| in pipelines: 03(GETNEXT), 07(OPEN)
|
|--07:AGGREGATE [FINALIZE]
| | group by: cs_bill_customer_sk, cs_item_sk
-| | mem-estimate=38.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| | mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| | tuple-ids=6 row-size=12B cardinality=1.44M
| | in pipelines: 07(GETNEXT), 04(OPEN)
| |
@@ -97,7 +97,7 @@ PLAN-ROOT SINK
|
03:AGGREGATE [FINALIZE]
| group by: ss_customer_sk, ss_item_sk
-| mem-estimate=76.92MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=65.93MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=2 row-size=12B cardinality=2.88M
| in pipelines: 03(GETNEXT), 00(OPEN)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test
index 09e3342..6f578da 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test
@@ -31,9 +31,9 @@ order by
limit 1000
---- PLAN
Max Per-Host Resource Reservation: Memory=52.00MB Threads=4
-Per-Host Resource Estimates: Memory=346MB
+Per-Host Resource Estimates: Memory=342MB
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-| Per-Host Resources: mem-estimate=345.70MB mem-reservation=52.00MB thread-reservation=4 runtime-filters-memory=2.00MB
+| Per-Host Resources: mem-estimate=342.41MB mem-reservation=52.00MB thread-reservation=4 runtime-filters-memory=2.00MB
PLAN-ROOT SINK
| output exprs: i_item_desc, i_category, i_class, i_current_price, sum(ss_ext_sales_price), sum(ss_ext_sales_price) * CAST(100 AS DECIMAL(3,0)) / sum(sum(ss_ext_sales_price))
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
@@ -60,7 +60,7 @@ PLAN-ROOT SINK
05:AGGREGATE [FINALIZE]
| output: sum(ss_ext_sales_price)
| group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-| mem-estimate=176.44MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=173.15MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=198B cardinality=864.12K
| in pipelines: 05(GETNEXT), 00(OPEN)
|
@@ -118,7 +118,7 @@ PLAN-ROOT SINK
in pipelines: 00(GETNEXT)
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=98.81MB Threads=8
-Per-Host Resource Estimates: Memory=334MB
+Per-Host Resource Estimates: Memory=332MB
F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Host Resources: mem-estimate=4.69MB mem-reservation=4.00MB thread-reservation=1
PLAN-ROOT SINK
@@ -133,7 +133,7 @@ PLAN-ROOT SINK
| in pipelines: 08(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(i_class)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=117.23MB mem-reservation=50.00MB thread-reservation=1
+Per-Host Resources: mem-estimate=116.13MB mem-reservation=50.00MB thread-reservation=1
08:TOP-N [LIMIT=1000]
| order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
| mem-estimate=209.09KB mem-reservation=0B thread-reservation=0
@@ -156,7 +156,7 @@ Per-Host Resources: mem-estimate=117.23MB mem-reservation=50.00MB thread-reserva
12:AGGREGATE [FINALIZE]
| output: sum:merge(ss_ext_sales_price)
| group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-| mem-estimate=58.81MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=57.72MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=198B cardinality=864.12K
| in pipelines: 12(GETNEXT), 00(OPEN)
|
@@ -166,11 +166,11 @@ Per-Host Resources: mem-estimate=117.23MB mem-reservation=50.00MB thread-reserva
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=84.30MB mem-reservation=41.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+Per-Host Resources: mem-estimate=83.48MB mem-reservation=41.81MB thread-reservation=2 runtime-filters-memory=2.00MB
05:AGGREGATE [STREAMING]
| output: sum(ss_ext_sales_price)
| group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-| mem-estimate=44.11MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+| mem-estimate=43.29MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=3 row-size=198B cardinality=864.12K
| in pipelines: 00(GETNEXT)
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
index e54f6a3..23d59df 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
@@ -1253,7 +1253,7 @@ order by
l_year
---- PLAN
Max Per-Host Resource Reservation: Memory=79.33MB Threads=7
-Per-Host Resource Estimates: Memory=706MB
+Per-Host Resource Estimates: Memory=690MB
PLAN-ROOT SINK
|
12:SORT
@@ -1570,7 +1570,7 @@ group by
order by
o_year
---- PLAN
-Max Per-Host Resource Reservation: Memory=51.21MB Threads=9
+Max Per-Host Resource Reservation: Memory=50.71MB Threads=9
Per-Host Resource Estimates: Memory=713MB
PLAN-ROOT SINK
|
@@ -1957,7 +1957,7 @@ order by
o_year desc
---- PLAN
Max Per-Host Resource Reservation: Memory=114.76MB Threads=7
-Per-Host Resource Estimates: Memory=914MB
+Per-Host Resource Estimates: Memory=890MB
PLAN-ROOT SINK
|
12:SORT
@@ -2023,7 +2023,7 @@ PLAN-ROOT SINK
row-size=48B cardinality=6.00M
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=145.63MB Threads=15
-Per-Host Resource Estimates: Memory=918MB
+Per-Host Resource Estimates: Memory=909MB
PLAN-ROOT SINK
|
21:MERGING-EXCHANGE [UNPARTITIONED]
@@ -2110,8 +2110,8 @@ PLAN-ROOT SINK
runtime filters: RF002 -> l_partkey, RF003 -> l_suppkey, RF006 -> l_suppkey, RF008 -> l_orderkey, RF010 -> l_partkey
row-size=48B cardinality=6.00M
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=248.38MB Threads=18
-Per-Host Resource Estimates: Memory=702MB
+Max Per-Host Resource Reservation: Memory=214.38MB Threads=18
+Per-Host Resource Estimates: Memory=668MB
PLAN-ROOT SINK
|
21:MERGING-EXCHANGE [UNPARTITIONED]
@@ -2803,7 +2803,7 @@ order by
l_shipmode
---- PLAN
Max Per-Host Resource Reservation: Memory=51.00MB Threads=3
-Per-Host Resource Estimates: Memory=477MB
+Per-Host Resource Estimates: Memory=475MB
PLAN-ROOT SINK
|
04:SORT
@@ -2872,8 +2872,8 @@ PLAN-ROOT SINK
runtime filters: RF000 -> l_orderkey
row-size=90B cardinality=320.78K
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=130.88MB Threads=10
-Per-Host Resource Estimates: Memory=443MB
+Max Per-Host Resource Reservation: Memory=96.88MB Threads=10
+Per-Host Resource Estimates: Memory=409MB
PLAN-ROOT SINK
|
09:MERGING-EXCHANGE [UNPARTITIONED]
@@ -3677,8 +3677,8 @@ PLAN-ROOT SINK
runtime filters: RF000 -> tpch.lineitem.l_partkey
row-size=16B cardinality=6.00M
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=49.56MB Threads=8
-Per-Host Resource Estimates: Memory=626MB
+Max Per-Host Resource Reservation: Memory=46.75MB Threads=8
+Per-Host Resource Estimates: Memory=625MB
PLAN-ROOT SINK
|
12:AGGREGATE [FINALIZE]
@@ -3733,7 +3733,7 @@ PLAN-ROOT SINK
runtime filters: RF000 -> tpch.lineitem.l_partkey
row-size=16B cardinality=6.00M
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=80.50MB Threads=11
+Max Per-Host Resource Reservation: Memory=78.62MB Threads=11
Per-Host Resource Estimates: Memory=445MB
PLAN-ROOT SINK
|
@@ -3835,7 +3835,7 @@ order by
limit 100
---- PLAN
Max Per-Host Resource Reservation: Memory=120.50MB Threads=5
-Per-Host Resource Estimates: Memory=977MB
+Per-Host Resource Estimates: Memory=955MB
PLAN-ROOT SINK
|
09:TOP-N [LIMIT=100]
@@ -3887,7 +3887,7 @@ PLAN-ROOT SINK
row-size=16B cardinality=6.00M
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=217.75MB Threads=11
-Per-Host Resource Estimates: Memory=1.00GB
+Per-Host Resource Estimates: Memory=1016MB
PLAN-ROOT SINK
|
17:MERGING-EXCHANGE [UNPARTITIONED]
@@ -4592,7 +4592,7 @@ PLAN-ROOT SINK
predicates: l3.l_receiptdate > l3.l_commitdate
row-size=60B cardinality=600.12K
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=72.76MB Threads=15
+Max Per-Host Resource Reservation: Memory=64.26MB Threads=15
Per-Host Resource Estimates: Memory=1.09GB
PLAN-ROOT SINK
|
@@ -4685,8 +4685,8 @@ PLAN-ROOT SINK
predicates: l3.l_receiptdate > l3.l_commitdate
row-size=60B cardinality=600.12K
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=112.38MB Threads=22
-Per-Host Resource Estimates: Memory=807MB
+Max Per-Host Resource Reservation: Memory=104.88MB Threads=22
+Per-Host Resource Estimates: Memory=800MB
PLAN-ROOT SINK
|
21:MERGING-EXCHANGE [UNPARTITIONED]
@@ -4835,7 +4835,7 @@ group by
order by
cntrycode
---- PLAN
-Max Per-Host Resource Reservation: Memory=28.75MB Threads=4
+Max Per-Host Resource Reservation: Memory=26.88MB Threads=4
Per-Host Resource Estimates: Memory=314MB
PLAN-ROOT SINK
|
@@ -4878,7 +4878,7 @@ PLAN-ROOT SINK
HDFS partitions=1/1 files=1 size=162.56MB
row-size=8B cardinality=1.50M
---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=53.75MB Threads=10
+Max Per-Host Resource Reservation: Memory=50.81MB Threads=10
Per-Host Resource Estimates: Memory=364MB
PLAN-ROOT SINK
|
@@ -4947,7 +4947,7 @@ PLAN-ROOT SINK
HDFS partitions=1/1 files=1 size=162.56MB
row-size=8B cardinality=1.50M
---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=53.75MB Threads=9
+Max Per-Host Resource Reservation: Memory=50.81MB Threads=9
Per-Host Resource Estimates: Memory=212MB
PLAN-ROOT SINK
|
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
index b851b4a..3b77ce9 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
@@ -250,8 +250,8 @@ order by
o_orderdate
limit 10
---- PLAN
-Max Per-Host Resource Reservation: Memory=24.75MB Threads=4
-Per-Host Resource Estimates: Memory=36MB
+Max Per-Host Resource Reservation: Memory=23.81MB Threads=4
+Per-Host Resource Estimates: Memory=35MB
PLAN-ROOT SINK
|
06:TOP-N [LIMIT=10]
@@ -310,8 +310,8 @@ group by
order by
o_orderpriority
---- PLAN
-Max Per-Host Resource Reservation: Memory=19.94MB Threads=3
-Per-Host Resource Estimates: Memory=32MB
+Max Per-Host Resource Reservation: Memory=17.00MB Threads=3
+Per-Host Resource Estimates: Memory=24MB
PLAN-ROOT SINK
|
04:SORT
@@ -490,7 +490,7 @@ order by
l_year
---- PLAN
Max Per-Host Resource Reservation: Memory=55.25MB Threads=7
-Per-Host Resource Estimates: Memory=126MB
+Per-Host Resource Estimates: Memory=110MB
PLAN-ROOT SINK
|
12:SORT
@@ -706,7 +706,7 @@ order by
o_year desc
---- PLAN
Max Per-Host Resource Reservation: Memory=85.50MB Threads=7
-Per-Host Resource Estimates: Memory=200MB
+Per-Host Resource Estimates: Memory=176MB
PLAN-ROOT SINK
|
12:SORT
@@ -800,8 +800,8 @@ order by
revenue desc
limit 20
---- PLAN
-Max Per-Host Resource Reservation: Memory=72.94MB Threads=5
-Per-Host Resource Estimates: Memory=94MB
+Max Per-Host Resource Reservation: Memory=55.94MB Threads=5
+Per-Host Resource Estimates: Memory=77MB
PLAN-ROOT SINK
|
08:TOP-N [LIMIT=20]
@@ -975,7 +975,7 @@ order by
l_shipmode
---- PLAN
Max Per-Host Resource Reservation: Memory=36.94MB Threads=3
-Per-Host Resource Estimates: Memory=55MB
+Per-Host Resource Estimates: Memory=53MB
PLAN-ROOT SINK
|
04:SORT
@@ -1069,8 +1069,8 @@ where
and l_shipdate >= '1995-09-01'
and l_shipdate < '1995-10-01'
---- PLAN
-Max Per-Host Resource Reservation: Memory=35.00MB Threads=3
-Per-Host Resource Estimates: Memory=42MB
+Max Per-Host Resource Reservation: Memory=18.00MB Threads=3
+Per-Host Resource Estimates: Memory=26MB
PLAN-ROOT SINK
|
03:AGGREGATE [FINALIZE]
@@ -1328,7 +1328,7 @@ order by
limit 100
---- PLAN
Max Per-Host Resource Reservation: Memory=96.50MB Threads=5
-Per-Host Resource Estimates: Memory=236MB
+Per-Host Resource Estimates: Memory=214MB
PLAN-ROOT SINK
|
09:TOP-N [LIMIT=100]
@@ -1576,8 +1576,8 @@ order by
s_name
limit 100
---- PLAN
-Max Per-Host Resource Reservation: Memory=44.75MB Threads=7
-Per-Host Resource Estimates: Memory=64MB
+Max Per-Host Resource Reservation: Memory=27.75MB Threads=7
+Per-Host Resource Estimates: Memory=47MB
PLAN-ROOT SINK
|
12:TOP-N [LIMIT=100]
@@ -1677,7 +1677,7 @@ order by
cntrycode
---- PLAN
Max Per-Host Resource Reservation: Memory=16.00MB Threads=4
-Per-Host Resource Estimates: Memory=26MB
+Per-Host Resource Estimates: Memory=22MB
PLAN-ROOT SINK
|
08:SORT
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
index c5a158d..7c1b6fc 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
@@ -2409,7 +2409,7 @@ where
)
---- PLAN
Max Per-Host Resource Reservation: Memory=96.94MB Threads=4
-Per-Host Resource Estimates: Memory=1.16GB
+Per-Host Resource Estimates: Memory=1.04GB
PLAN-ROOT SINK
|
06:AGGREGATE [FINALIZE]
@@ -2448,7 +2448,7 @@ PLAN-ROOT SINK
row-size=24B cardinality=15.00M
---- DISTRIBUTEDPLAN
Max Per-Host Resource Reservation: Memory=158.94MB Threads=8
-Per-Host Resource Estimates: Memory=1.01GB
+Per-Host Resource Estimates: Memory=990MB
PLAN-ROOT SINK
|
12:AGGREGATE [FINALIZE]
@@ -2742,7 +2742,7 @@ where
order by
s_name
---- PLAN
-Max Per-Host Resource Reservation: Memory=107.81MB Threads=5
+Max Per-Host Resource Reservation: Memory=90.81MB Threads=5
Per-Host Resource Estimates: Memory=888MB
PLAN-ROOT SINK
|
diff --git a/testdata/workloads/functional-query/queries/QueryTest/spilling-broadcast-joins.test b/testdata/workloads/functional-query/queries/QueryTest/spilling-broadcast-joins.test
index 3438e09..ffc4ace 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/spilling-broadcast-joins.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/spilling-broadcast-joins.test
@@ -70,7 +70,7 @@ row_regex: .*NumRepartitions: .* \([1-9][0-9]*\)
====
---- QUERY
# Spilling broadcast join with empty probe-side partitions.
-set buffer_pool_limit=50m;
+set buffer_pool_limit=46m;
select straight_join count(*)
from
lineitem a join /*+broadcast*/ lineitem b on a.l_orderkey = b.l_orderkey
diff --git a/testdata/workloads/functional-query/queries/QueryTest/spilling.test b/testdata/workloads/functional-query/queries/QueryTest/spilling.test
index 3ef2efc..f797f7f 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/spilling.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/spilling.test
@@ -60,7 +60,7 @@ row_regex: .*SpilledPartitions: 0 .*
# Adding TPCH-Q21 in the spilling test to check for IMPALA-1471 (spilling left anti
# and left outer joins were returning wrong results).
# Q21 - Suppliers Who Kept Orders Waiting Query
-set buffer_pool_limit=100m;
+set buffer_pool_limit=90m;
select
s_name,
count(*) as numwait