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

arawat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit d47d305bf42f963ba6fac18c014e96c734e9e9ff
Author: xqhe <[email protected]>
AuthorDate: Thu Jul 7 15:36:54 2022 +0800

    IMPALA-11418: A statement that returns at most one row need not to spool 
results
    
    A query that returns at most one row can run more efficiently without
    result spooling. If result spooling is enabled, it will set the
    minimum memory reservation in PlanRootSink, e.g. 'select 1' minimum
    memory reservation is 4MB.
    
    This optimization can reduce the statement's resource reservation and
    prevent the exception 'Failed to get minimum memory reservation' when
    the host memory limit not available.
    
    Testing:
    - Add tests in result-spooling.test
    
    Change-Id: Icd4d73c21106048df68a270cf03d4abd56bd3aac
    Reviewed-on: http://gerrit.cloudera.org:8080/18711
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 .../apache/impala/analysis/AnalysisContext.java    |   9 ++
 .../java/org/apache/impala/service/Frontend.java   |   8 +-
 .../PlannerTest/bloom-filter-assignment.test       |  20 ++--
 .../queries/PlannerTest/constant-folding.test      |   4 +-
 ...-runtime-filters-hdfs-num-rows-est-enabled.test |   2 +-
 .../PlannerTest/min-max-runtime-filters.test       |  10 +-
 .../queries/PlannerTest/mt-dop-validation.test     |   8 +-
 .../PlannerTest/parquet-filtering-disabled.test    |   8 +-
 .../queries/PlannerTest/parquet-filtering.test     |  16 ++--
 .../queries/PlannerTest/resource-requirements.test |  26 +++---
 .../queries/PlannerTest/result-spooling.test       | 104 +++++++++++++++++++++
 .../PlannerTest/runtime-filter-query-options.test  |  10 +-
 .../queries/PlannerTest/tablesample.test           |   4 +-
 .../queries/PlannerTest/tpcds/tpcds-q13.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q16.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q23a.test      |  14 +--
 .../queries/PlannerTest/tpcds/tpcds-q32.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q38.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q48.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q87.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q92.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q94.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q95.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q96.test       |  18 ++--
 .../queries/PlannerTest/tpcds/tpcds-q97.test       |  18 ++--
 .../queries/PlannerTest/tpch-all.test              |  32 +++----
 .../queries/PlannerTest/tpch-kudu.test             |   4 +-
 .../queries/PlannerTest/tpch-nested.test           |  16 ++--
 .../QueryTest/admission-max-min-mem-limits.test    |  12 +--
 .../QueryTest/dedicated-coord-mem-estimates.test   |   6 +-
 .../queries/QueryTest/explain-level2.test          |   2 +-
 tests/query_test/test_observability.py             |   3 +-
 32 files changed, 316 insertions(+), 200 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java 
b/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
index bb21809a7..f151cf19c 100644
--- a/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
+++ b/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
@@ -471,6 +471,15 @@ public class AnalysisContext {
     } finally {
       authzChecker.postAnalyze(authzCtx);
     }
+    // A statement that returns at most one row does not need to spool query 
results.
+    if (analysisException == null && analysisResult_.stmt_ instanceof 
SelectStmt &&
+        ((SelectStmt)analysisResult_.stmt_).returnsAtMostOneRow()) {
+      clientRequest.query_options.setSpool_query_results(false);
+      if (LOG.isTraceEnabled()) {
+        LOG.trace("Result spooling is disabled due to the statement returning 
at most "
+            + "one row.");
+      }
+    }
     long durationMs = timeline_.markEvent("Analysis finished") / 1000000;
     LOG.info("Analysis took {} ms", durationMs);
 
diff --git a/fe/src/main/java/org/apache/impala/service/Frontend.java 
b/fe/src/main/java/org/apache/impala/service/Frontend.java
index 99e2ae7f3..79fdf0aac 100644
--- a/fe/src/main/java/org/apache/impala/service/Frontend.java
+++ b/fe/src/main/java/org/apache/impala/service/Frontend.java
@@ -1821,13 +1821,15 @@ public class Frontend {
       }
       TExecutorGroupSet new_entry = new TExecutorGroupSet(e);
       if (poolService != null) {
-        // Find out the max_mem_limit from the pool service
+        // Find out the max_mem_limit from the pool service. Set to 
max_mem_limit when it
+        // is greater than 0, otherwise set to max possible threshold value.
         TPoolConfig poolConfig =
             poolService.getPoolConfig(e.getExec_group_name_prefix());
         Preconditions.checkNotNull(poolConfig);
-        new_entry.setMax_mem_limit(poolConfig.getMax_query_mem_limit());
+        new_entry.setMax_mem_limit(poolConfig.getMax_query_mem_limit() > 0 ?
+            poolConfig.getMax_query_mem_limit() : Long.MAX_VALUE);
       } else {
-        // Set to max possible thresold value when there is no pool service
+        // Set to max possible threshold value when there is no pool service
         new_entry.setMax_mem_limit(Long.MAX_VALUE);
       }
       result.add(new_entry);
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/bloom-filter-assignment.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/bloom-filter-assignment.test
index 9aa82ecc3..c141b52cc 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/bloom-filter-assignment.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/bloom-filter-assignment.test
@@ -10,7 +10,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=34.94MB mem-reservation=2.97MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -61,7 +61,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=4.44MB mem-reservation=2.94MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -100,7 +100,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=19.69MB mem-reservation=2.95MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -145,7 +145,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=19.69MB mem-reservation=2.95MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -190,7 +190,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=19.69MB mem-reservation=2.95MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -235,7 +235,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=18.69MB mem-reservation=1.95MB 
thread-reservation=3
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -280,7 +280,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=54.62MB mem-reservation=5.91MB 
thread-reservation=4 runtime-filters-memory=2.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -351,7 +351,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=54.62MB mem-reservation=5.91MB 
thread-reservation=4 runtime-filters-memory=2.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -421,7 +421,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=55.62MB mem-reservation=6.91MB 
thread-reservation=4 runtime-filters-memory=3.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -492,7 +492,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=24.38MB mem-reservation=6.89MB 
thread-reservation=4 runtime-filters-memory=3.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
index 16f3d2bc4..2baf1d42a 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
@@ -317,7 +317,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=138.00MB mem-reservation=4.00MB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: sum(2 + id)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:AGGREGATE [FINALIZE]
 |  output: sum(2 + id), count:merge(*)
@@ -463,7 +463,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.02MB mem-reservation=4.00MB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: sum(id + c3)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: sum(CAST(id AS BIGINT) + CAST(CAST(10 AS INT) + CAST(CAST(20 AS 
SMALLINT) + CAST(30 AS SMALLINT) AS INT) AS BIGINT))
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters-hdfs-num-rows-est-enabled.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters-hdfs-num-rows-est-enabled.test
index e5aa22767..40deb4a94 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters-hdfs-num-rows-est-enabled.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters-hdfs-num-rows-est-enabled.test
@@ -11,7 +11,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=21.38MB mem-reservation=4.00MB 
thread-reservation=4
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
index bb9f5ecfa..41b53fb74 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
@@ -6,7 +6,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=4.94MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -44,7 +44,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=6.44MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -81,7 +81,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=7.94MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -117,7 +117,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=2.02GB mem-reservation=36.95MB 
thread-reservation=4
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -173,7 +173,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=6.88MB mem-reservation=3.88MB 
thread-reservation=4
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=100.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
index f4f0d1469..a22b1732e 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
@@ -7,7 +7,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Instance Resources: mem-estimate=2.03GB mem-reservation=16.00KB 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -46,7 +46,7 @@ F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Instance Resources: mem-estimate=116.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 06:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -118,7 +118,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Instance Resources: mem-estimate=2.03GB mem-reservation=35.02MB 
thread-reservation=1 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -161,7 +161,7 @@ F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Instance Resources: mem-estimate=116.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 06:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering-disabled.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering-disabled.test
index eb95d348b..04e2d1ea8 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering-disabled.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering-disabled.test
@@ -12,7 +12,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=32.10MB mem-reservation=16.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -50,7 +50,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=88.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -82,7 +82,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=48.10MB mem-reservation=24.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -332,7 +332,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=88.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
index 3d0a4f143..52ff1c575 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
@@ -11,7 +11,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=32.10MB mem-reservation=16.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -42,7 +42,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=32.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -75,7 +75,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=88.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -111,7 +111,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=32.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -146,7 +146,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=48.10MB mem-reservation=24.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -458,7 +458,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=16.10MB mem-reservation=8.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -586,7 +586,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=128.10MB mem-reservation=88.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -623,7 +623,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=100.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
index 5fc965b60..554041c6a 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
@@ -1867,16 +1867,16 @@ Per-Instance Resources: mem-estimate=120.06MB 
mem-reservation=38.00MB thread-res
 # Non-grouping aggregation with zero-slot parquet scan
 select count(*) from tpch_parquet.lineitem
 ---- PLAN
-Max Per-Host Resource Reservation: Memory=4.00MB Threads=2
+Max Per-Host Resource Reservation: Memory=128.00KB Threads=2
 Per-Host Resource Estimates: Memory=10MB
 Codegen disabled by planner
 Analyzed query: SELECT count(*) FROM tpch_parquet.lineitem
 
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=2
+|  Per-Host Resources: mem-estimate=1.02MB mem-reservation=128.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: sum_init_zero(tpch_parquet.lineitem.stats: num_rows)
@@ -1894,16 +1894,16 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=8B cardinality=3
    in pipelines: 00(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=4.12MB Threads=3
+Max Per-Host Resource Reservation: Memory=128.00KB Threads=3
 Per-Host Resource Estimates: Memory=10MB
 Codegen disabled by planner
 Analyzed query: SELECT count(*) FROM tpch_parquet.lineitem
 
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -1934,16 +1934,16 @@ Per-Host Resources: mem-estimate=1.02MB 
mem-reservation=128.00KB thread-reservat
    tuple-ids=0 row-size=8B cardinality=3
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=4.12MB Threads=2
-Per-Host Resource Estimates: Memory=84MB
+Max Per-Host Resource Reservation: Memory=128.00KB Threads=2
+Per-Host Resource Estimates: Memory=80MB
 Codegen disabled by planner
 Analyzed query: SELECT count(*) FROM tpch_parquet.lineitem
 
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -5847,16 +5847,16 @@ PLAN-ROOT SINK
 # Kudu Scan count(*)
 select count(*) from functional_kudu.alltypes
 ---- PLAN
-Max Per-Host Resource Reservation: Memory=4.00MB Threads=2
+Max Per-Host Resource Reservation: Memory=0B Threads=2
 Per-Host Resource Estimates: Memory=10MB
 Codegen disabled by planner
 Analyzed query: SELECT count(*) FROM functional_kudu.alltypes
 
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=2
+|  Per-Host Resources: mem-estimate=400.00KB mem-reservation=0B 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: sum_init_zero(functional_kudu.alltypes.stats: num_rows)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/result-spooling.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/result-spooling.test
index 88d16695a..10b5a6644 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/result-spooling.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/result-spooling.test
@@ -138,3 +138,107 @@ Per-Instance Resources: mem-estimate=308.13MB 
mem-reservation=20.00MB thread-res
    tuple-ids=0 row-size=231B cardinality=6.00M
    in pipelines: 00(GETNEXT)
 ====
+# Select stmt returning one constant row does not need to spool query results.
+select 1, uuid()
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=0B Threads=1
+Per-Host Resource Estimates: Memory=10MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: 1, uuid()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+00:UNION
+   constant-operands=1
+   mem-estimate=0B mem-reservation=0B thread-reservation=0
+   tuple-ids=0 row-size=13B cardinality=1
+   in pipelines: <none>
+====
+# Select from an inline view that returns one row does not need to spool query 
results
+select a, b from (select 1 a, uuid() b) t
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=0B Threads=1
+Per-Host Resource Estimates: Memory=10MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: a, b
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+00:UNION
+   constant-operands=1
+   mem-estimate=0B mem-reservation=0B thread-reservation=0
+   tuple-ids=0 row-size=13B cardinality=1
+   in pipelines: <none>
+====
+# Select stmt with a 'limit 1' clause does not need to spool query results
+select id from functional.dimtbl limit 1
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=8.00KB Threads=3
+Per-Host Resource Estimates: Memory=16MB
+F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B 
thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: id
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+01:EXCHANGE [UNPARTITIONED]
+|  limit: 1
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0 row-size=8B cardinality=1
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB 
thread-reservation=2
+00:SCAN HDFS [functional.dimtbl, RANDOM]
+   HDFS partitions=1/1 files=1 size=171B
+   stored statistics:
+     table: rows=10 size=171B
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=10
+   limit: 1
+   mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=1
+   in pipelines: 00(GETNEXT)
+====
+# Select stmt with an aggregate function and no group by does not need to 
spool query results
+select count(*) from functional.dimtbl
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=8.00KB Threads=3
+Per-Host Resource Estimates: Memory=16MB
+F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+03:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
+|  tuple-ids=1 row-size=8B cardinality=1
+|  in pipelines: 03(GETNEXT), 01(OPEN)
+|
+02:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1 row-size=8B cardinality=1
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=16.02MB mem-reservation=8.00KB 
thread-reservation=2
+01:AGGREGATE
+|  output: count(*)
+|  mem-estimate=16.00KB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
+|  tuple-ids=1 row-size=8B cardinality=1
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+00:SCAN HDFS [functional.dimtbl, RANDOM]
+   HDFS partitions=1/1 files=1 size=171B
+   stored statistics:
+     table: rows=10 size=171B
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=10
+   mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+   tuple-ids=0 row-size=0B cardinality=10
+   in pipelines: 00(GETNEXT)
+====
\ No newline at end of file
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-query-options.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-query-options.test
index a8d13fbb6..fa0291438 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-query-options.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/runtime-filter-query-options.test
@@ -676,7 +676,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=5.02MB mem-reservation=5.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -715,7 +715,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=3
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -754,7 +754,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=5.02MB mem-reservation=5.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -794,7 +794,7 @@ F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 06:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -866,7 +866,7 @@ F03:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 07:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tablesample.test 
b/testdata/workloads/functional-planner/queries/PlannerTest/tablesample.test
index 2b61a833e..ec8b7f7a1 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tablesample.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tablesample.test
@@ -270,10 +270,10 @@ PLAN-ROOT SINK
 select count(*) from functional_parquet.iceberg_non_partitioned tablesample 
system(10) repeatable(1234)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=32.02MB mem-reservation=4.00MB 
thread-reservation=2
+|  Per-Host Resources: mem-estimate=32.02MB mem-reservation=8.00KB 
thread-reservation=2
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
index bcd85ddb4..b50e2c28a 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
@@ -54,7 +54,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=316.75MB mem-reservation=26.70MB 
thread-reservation=7 runtime-filters-memory=5.00MB
 PLAN-ROOT SINK
 |  output exprs: avg(ss_quantity), avg(ss_ext_sales_price), 
avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 11:AGGREGATE [FINALIZE]
 |  output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_ext_sales_price), 
avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
@@ -180,13 +180,13 @@ PLAN-ROOT SINK
    tuple-ids=2 row-size=39B cardinality=181.75K
    in pipelines: 02(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=40.08MB Threads=14
-Per-Host Resource Estimates: Memory=339MB
+Max Per-Host Resource Reservation: Memory=36.08MB Threads=14
+Per-Host Resource Estimates: Memory=335MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: avg(ss_quantity), avg(ss_ext_sales_price), 
avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 19:AGGREGATE [FINALIZE]
 |  output: avg:merge(ss_quantity), avg:merge(ss_ext_sales_price), 
avg:merge(ss_ext_wholesale_cost), sum:merge(ss_ext_wholesale_cost)
@@ -366,13 +366,13 @@ Per-Host Resources: mem-estimate=139.26MB 
mem-reservation=14.81MB thread-reserva
    tuple-ids=0 row-size=40B cardinality=288.04K
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=56.83MB Threads=16
-Per-Host Resource Estimates: Memory=167MB
+Max Per-Host Resource Reservation: Memory=52.83MB Threads=16
+Per-Host Resource Estimates: Memory=164MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: avg(ss_quantity), avg(ss_ext_sales_price), 
avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 19:AGGREGATE [FINALIZE]
 |  output: avg:merge(ss_quantity), avg:merge(ss_ext_sales_price), 
avg:merge(ss_ext_wholesale_cost), sum:merge(ss_ext_wholesale_cost)
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 c1a68e474..244687d19 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
@@ -30,7 +30,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(cs_order_number) ASC
@@ -160,13 +160,13 @@ PLAN-ROOT SINK
    tuple-ids=4 row-size=12B cardinality=1.44M
    in pipelines: 04(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=45.77MB Threads=14
-Per-Host Resource Estimates: Memory=588MB
+Max Per-Host Resource Reservation: Memory=41.77MB Threads=14
+Per-Host Resource Estimates: Memory=584MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(cs_order_number) ASC
@@ -351,13 +351,13 @@ 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=54.58MB Threads=13
-Per-Host Resource Estimates: Memory=216MB
+Max Per-Host Resource Reservation: Memory=50.58MB Threads=13
+Per-Host Resource Estimates: Memory=212MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(cs_order_number) ASC
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 984257d74..a501f7c83 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
@@ -55,7 +55,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 49:AGGREGATE [FINALIZE]
 |  output: sum(sales)
@@ -507,13 +507,13 @@ PLAN-ROOT SINK
    tuple-ids=8 row-size=12B cardinality=2.88M
    in pipelines: 09(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=270.38MB Threads=50
+Max Per-Host Resource Reservation: Memory=266.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
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(sales)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 89:AGGREGATE [FINALIZE]
 |  output: sum:merge(sales)
@@ -1240,13 +1240,13 @@ Per-Host Resources: mem-estimate=65.14MB 
mem-reservation=12.75MB thread-reservat
    tuple-ids=8 row-size=12B cardinality=2.88M
    in pipelines: 09(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=501.12MB Threads=63
+Max Per-Host Resource Reservation: Memory=497.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
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(sales)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 89:AGGREGATE [FINALIZE]
 |  output: sum:merge(sales)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
index 4946724e1..78a4a1e28 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
@@ -22,7 +22,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=391.88MB mem-reservation=28.75MB 
thread-reservation=6 runtime-filters-memory=4.00MB
 PLAN-ROOT SINK
 |  output exprs: sum(cs_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 10:AGGREGATE [FINALIZE]
 |  output: sum(cs_ext_discount_amt)
@@ -132,13 +132,13 @@ PLAN-ROOT SINK
    tuple-ids=3 row-size=16B cardinality=1.44M
    in pipelines: 03(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=39.94MB Threads=13
-Per-Host Resource Estimates: Memory=423MB
+Max Per-Host Resource Reservation: Memory=35.94MB Threads=13
+Per-Host Resource Estimates: Memory=419MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(cs_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 19:AGGREGATE [FINALIZE]
 |  output: sum:merge(cs_ext_discount_amt)
@@ -309,13 +309,13 @@ Per-Host Resources: mem-estimate=158.15MB 
mem-reservation=13.94MB thread-reserva
    tuple-ids=3 row-size=16B cardinality=1.44M
    in pipelines: 03(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=45.81MB Threads=12
-Per-Host Resource Estimates: Memory=189MB
+Max Per-Host Resource Reservation: Memory=41.81MB Threads=12
+Per-Host Resource Estimates: Memory=185MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(cs_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 19:AGGREGATE [FINALIZE]
 |  output: sum:merge(cs_ext_discount_amt)
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 14437691c..6932c4722 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
@@ -34,7 +34,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 20:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -230,13 +230,13 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=8B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=340.81MB Threads=22
-Per-Host Resource Estimates: Memory=903MB
+Max Per-Host Resource Reservation: Memory=336.81MB Threads=22
+Per-Host Resource Estimates: Memory=899MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 36:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -540,13 +540,13 @@ Per-Host Resources: mem-estimate=80.58MB 
mem-reservation=46.94MB thread-reservat
    tuple-ids=0 row-size=8B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=484.62MB Threads=25
-Per-Host Resource Estimates: Memory=769MB
+Max Per-Host Resource Reservation: Memory=480.62MB Threads=25
+Per-Host Resource Estimates: Memory=765MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 36:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
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 8bd224bc9..37542b51d 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
@@ -46,7 +46,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 09:AGGREGATE [FINALIZE]
 |  output: sum(CAST(ss_quantity AS BIGINT))
@@ -150,13 +150,13 @@ PLAN-ROOT SINK
    tuple-ids=2 row-size=39B cardinality=181.75K
    in pipelines: 02(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=35.08MB Threads=12
-Per-Host Resource Estimates: Memory=272MB
+Max Per-Host Resource Reservation: Memory=31.08MB Threads=12
+Per-Host Resource Estimates: Memory=268MB
 F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(ss_quantity)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 16:AGGREGATE [FINALIZE]
 |  output: sum:merge(ss_quantity)
@@ -307,13 +307,13 @@ Per-Host Resources: mem-estimate=104.29MB 
mem-reservation=9.88MB thread-reservat
    tuple-ids=0 row-size=28B cardinality=288.04K
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=46.89MB Threads=14
-Per-Host Resource Estimates: Memory=146MB
+Max Per-Host Resource Reservation: Memory=42.89MB Threads=14
+Per-Host Resource Estimates: Memory=142MB
 F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(ss_quantity)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 16:AGGREGATE [FINALIZE]
 |  output: sum:merge(ss_quantity)
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 162daeea6..c45aa0be2 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
@@ -36,7 +36,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 20:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -225,13 +225,13 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=8B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=330.81MB Threads=22
-Per-Host Resource Estimates: Memory=893MB
+Max Per-Host Resource Reservation: Memory=326.81MB Threads=22
+Per-Host Resource Estimates: Memory=889MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 36:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -528,13 +528,13 @@ Per-Host Resources: mem-estimate=80.58MB 
mem-reservation=46.94MB thread-reservat
    tuple-ids=0 row-size=8B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=470.62MB Threads=25
-Per-Host Resource Estimates: Memory=755MB
+Max Per-Host Resource Reservation: Memory=466.62MB Threads=25
+Per-Host Resource Estimates: Memory=751MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 36:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
index e910be514..3cd762f93 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
@@ -24,7 +24,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=295.88MB mem-reservation=28.75MB 
thread-reservation=6 runtime-filters-memory=4.00MB
 PLAN-ROOT SINK
 |  output exprs: sum(ws_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 11:TOP-N [LIMIT=100]
 |  order by: sum(ws_ext_discount_amt) ASC
@@ -139,13 +139,13 @@ PLAN-ROOT SINK
    tuple-ids=3 row-size=16B cardinality=719.38K
    in pipelines: 03(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=39.94MB Threads=13
-Per-Host Resource Estimates: Memory=327MB
+Max Per-Host Resource Reservation: Memory=35.94MB Threads=13
+Per-Host Resource Estimates: Memory=323MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(ws_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 11:TOP-N [LIMIT=100]
 |  order by: sum(ws_ext_discount_amt) ASC
@@ -321,13 +321,13 @@ Per-Host Resources: mem-estimate=110.15MB 
mem-reservation=13.94MB thread-reserva
    tuple-ids=3 row-size=16B cardinality=719.38K
    in pipelines: 03(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=45.81MB Threads=12
-Per-Host Resource Estimates: Memory=156MB
+Max Per-Host Resource Reservation: Memory=41.81MB Threads=12
+Per-Host Resource Estimates: Memory=152MB
 F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: sum(ws_ext_discount_amt)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 11:TOP-N [LIMIT=100]
 |  order by: sum(ws_ext_discount_amt) ASC
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
index 130f80afd..10f2409b9 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
@@ -32,7 +32,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=409.81MB mem-reservation=30.25MB 
thread-reservation=7 runtime-filters-memory=4.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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
@@ -162,13 +162,13 @@ PLAN-ROOT SINK
    tuple-ids=6 row-size=8B cardinality=71.76K
    in pipelines: 05(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=42.33MB Threads=15
-Per-Host Resource Estimates: Memory=435MB
+Max Per-Host Resource Reservation: Memory=38.33MB Threads=15
+Per-Host Resource Estimates: Memory=431MB
 F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
@@ -360,13 +360,13 @@ Per-Host Resources: mem-estimate=65.00MB 
mem-reservation=3.00MB thread-reservati
    tuple-ids=4 row-size=12B cardinality=719.38K
    in pipelines: 04(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=48.20MB Threads=14
-Per-Host Resource Estimates: Memory=170MB
+Max Per-Host Resource Reservation: Memory=44.20MB Threads=14
+Per-Host Resource Estimates: Memory=166MB
 F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 13:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
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 3d23f1ede..fe88fa396 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
@@ -35,7 +35,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 21:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
@@ -236,13 +236,13 @@ PLAN-ROOT SINK
    tuple-ids=9 row-size=12B cardinality=719.38K
    in pipelines: 08(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=131.20MB Threads=21
-Per-Host Resource Estimates: Memory=690MB
+Max Per-Host Resource Reservation: Memory=127.20MB Threads=21
+Per-Host Resource Estimates: Memory=686MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 21:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
@@ -526,13 +526,13 @@ Per-Host Resources: mem-estimate=67.00MB 
mem-reservation=5.00MB thread-reservati
    tuple-ids=9 row-size=12B cardinality=719.38K
    in pipelines: 08(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=140.95MB Threads=20
-Per-Host Resource Estimates: Memory=374MB
+Max Per-Host Resource Reservation: Memory=136.95MB Threads=20
+Per-Host Resource Estimates: Memory=370MB
 F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.00MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 21:TOP-N [LIMIT=100]
 |  order by: count(ws_order_number) ASC
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
index 621eb8cfe..4f1067e59 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
@@ -20,7 +20,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  Per-Host Resources: mem-estimate=168.81MB mem-reservation=10.39MB 
thread-reservation=5 runtime-filters-memory=3.00MB
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 07:AGGREGATE [FINALIZE]
 |  output: count(*)
@@ -103,13 +103,13 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=12B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=14.39MB Threads=9
-Per-Host Resource Estimates: Memory=173MB
+Max Per-Host Resource Reservation: Memory=10.39MB Threads=9
+Per-Host Resource Estimates: Memory=169MB
 F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 12:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
@@ -226,13 +226,13 @@ Per-Host Resources: mem-estimate=56.87MB 
mem-reservation=9.81MB thread-reservati
    tuple-ids=0 row-size=12B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=24.20MB Threads=9
-Per-Host Resource Estimates: Memory=102MB
+Max Per-Host Resource Reservation: Memory=20.20MB Threads=9
+Per-Host Resource Estimates: Memory=98MB
 F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 PLAN-ROOT SINK
 |  output exprs: count(*)
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 12:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
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 609ce2c36..f22454563 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
@@ -41,7 +41,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
 |  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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 09:AGGREGATE [FINALIZE]
 |  output: sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND 
cs_bill_customer_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END 
AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NULL AND cs_bill_customer_sk 
IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), 
sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NOT 
NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
@@ -134,13 +134,13 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=16B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=151.88MB Threads=10
-Per-Host Resource Estimates: Memory=396MB
+Max Per-Host Resource Reservation: Memory=147.88MB Threads=10
+Per-Host Resource Estimates: Memory=392MB
 F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Host Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 17:AGGREGATE [FINALIZE]
 |  output: sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND 
csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN 
ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), 
sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT 
NULL THEN 1 ELSE 0 END)
@@ -286,13 +286,13 @@ Per-Host Resources: mem-estimate=69.00MB 
mem-reservation=37.94MB thread-reservat
    tuple-ids=0 row-size=16B cardinality=2.88M
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=158.75MB Threads=12
-Per-Host Resource Estimates: Memory=287MB
+Max Per-Host Resource Reservation: Memory=154.75MB Threads=12
+Per-Host Resource Estimates: Memory=283MB
 F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB 
thread-reservation=1
+|  Per-Instance Resources: mem-estimate=32.00KB mem-reservation=0B 
thread-reservation=1
 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
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 17:AGGREGATE [FINALIZE]
 |  output: sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND 
csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN 
ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), 
sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT 
NULL THEN 1 ELSE 0 END)
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
index 23d59df24..b7a7e15eb 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test
@@ -1173,8 +1173,8 @@ PLAN-ROOT SINK
    predicates: l_discount <= 0.07, l_discount >= 0.05, l_quantity < 24, 
l_shipdate < '1995-01-01', l_shipdate >= '1994-01-01'
    row-size=46B cardinality=600.12K
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=12.00MB Threads=3
-Per-Host Resource Estimates: Memory=268MB
+Max Per-Host Resource Reservation: Memory=8.00MB Threads=3
+Per-Host Resource Estimates: Memory=264MB
 PLAN-ROOT SINK
 |
 03:AGGREGATE [FINALIZE]
@@ -1192,8 +1192,8 @@ PLAN-ROOT SINK
    predicates: l_discount <= 0.07, l_discount >= 0.05, l_quantity < 24, 
l_shipdate < '1995-01-01', l_shipdate >= '1994-01-01'
    row-size=46B cardinality=600.12K
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=20.00MB Threads=3
-Per-Host Resource Estimates: Memory=180MB
+Max Per-Host Resource Reservation: Memory=16.00MB Threads=3
+Per-Host Resource Estimates: Memory=176MB
 PLAN-ROOT SINK
 |
 03:AGGREGATE [FINALIZE]
@@ -3111,8 +3111,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=46B cardinality=600.12K
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=30.50MB Threads=6
-Per-Host Resource Estimates: Memory=359MB
+Max Per-Host Resource Reservation: Memory=26.50MB Threads=6
+Per-Host Resource Estimates: Memory=355MB
 PLAN-ROOT SINK
 |
 07:AGGREGATE [FINALIZE]
@@ -3144,8 +3144,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=46B cardinality=600.12K
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=40.50MB Threads=8
-Per-Host Resource Estimates: Memory=258MB
+Max Per-Host Resource Reservation: Memory=36.50MB Threads=8
+Per-Host Resource Estimates: Memory=254MB
 PLAN-ROOT SINK
 |
 07:AGGREGATE [FINALIZE]
@@ -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=46.75MB Threads=8
-Per-Host Resource Estimates: Memory=625MB
+Max Per-Host Resource Reservation: Memory=42.75MB Threads=8
+Per-Host Resource Estimates: Memory=621MB
 PLAN-ROOT SINK
 |
 12:AGGREGATE [FINALIZE]
@@ -3733,8 +3733,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> tpch.lineitem.l_partkey
    row-size=16B cardinality=6.00M
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=78.62MB Threads=11
-Per-Host Resource Estimates: Memory=445MB
+Max Per-Host Resource Reservation: Memory=74.62MB Threads=11
+Per-Host Resource Estimates: Memory=441MB
 PLAN-ROOT SINK
 |
 12:AGGREGATE [FINALIZE]
@@ -4113,8 +4113,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=72B cardinality=197.63K
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=22.94MB Threads=5
-Per-Host Resource Estimates: Memory=335MB
+Max Per-Host Resource Reservation: Memory=18.94MB Threads=5
+Per-Host Resource Estimates: Memory=331MB
 PLAN-ROOT SINK
 |
 06:AGGREGATE [FINALIZE]
@@ -4146,8 +4146,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=72B cardinality=197.63K
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=33.88MB Threads=5
-Per-Host Resource Estimates: Memory=218MB
+Max Per-Host Resource Reservation: Memory=29.88MB Threads=5
+Per-Host Resource Estimates: Memory=214MB
 PLAN-ROOT SINK
 |
 06:AGGREGATE [FINALIZE]
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
index 3b77ce96b..1133c5bb7 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test
@@ -437,7 +437,7 @@ where
   and l_discount between 0.05 and 0.07
   and l_quantity < 24
 ---- PLAN
-Max Per-Host Resource Reservation: Memory=4.00MB Threads=2
+Max Per-Host Resource Reservation: Memory=0B Threads=2
 Per-Host Resource Estimates: Memory=10MB
 PLAN-ROOT SINK
 |
@@ -1412,7 +1412,7 @@ where
     )
   )
 ---- PLAN
-Max Per-Host Resource Reservation: Memory=5.00MB Threads=3
+Max Per-Host Resource Reservation: Memory=2.94MB Threads=3
 Per-Host Resource Estimates: Memory=15MB
 PLAN-ROOT SINK
 |
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test 
b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
index b012e9f18..352480215 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test
@@ -806,8 +806,8 @@ PLAN-ROOT SINK
    predicates: l_discount <= 0.07, l_discount >= 0.05, l_quantity < 24, 
l_shipdate < '1995-01-01', l_shipdate >= '1994-01-01'
    row-size=36B cardinality=1.50M
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=20.00MB Threads=3
-Per-Host Resource Estimates: Memory=356MB
+Max Per-Host Resource Reservation: Memory=16.00MB Threads=3
+Per-Host Resource Estimates: Memory=352MB
 PLAN-ROOT SINK
 |
 03:AGGREGATE [FINALIZE]
@@ -2074,8 +2074,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=36B cardinality=1.50M
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=40.00MB Threads=5
-Per-Host Resource Estimates: Memory=414MB
+Max Per-Host Resource Reservation: Memory=36.00MB Threads=5
+Per-Host Resource Estimates: Memory=410MB
 PLAN-ROOT SINK
 |
 06:AGGREGATE [FINALIZE]
@@ -2447,8 +2447,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l.l_partkey, RF002 -> l_partkey
    row-size=24B cardinality=15.00M
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=158.94MB Threads=8
-Per-Host Resource Estimates: Memory=990MB
+Max Per-Host Resource Reservation: Memory=154.94MB Threads=8
+Per-Host Resource Estimates: Memory=986MB
 PLAN-ROOT SINK
 |
 12:AGGREGATE [FINALIZE]
@@ -2674,8 +2674,8 @@ PLAN-ROOT SINK
    runtime filters: RF000 -> l_partkey
    row-size=56B cardinality=1.50M
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=32.94MB Threads=5
-Per-Host Resource Estimates: Memory=599MB
+Max Per-Host Resource Reservation: Memory=28.94MB Threads=5
+Per-Host Resource Estimates: Memory=595MB
 PLAN-ROOT SINK
 |
 06:AGGREGATE [FINALIZE]
diff --git 
a/testdata/workloads/functional-query/queries/QueryTest/admission-max-min-mem-limits.test
 
b/testdata/workloads/functional-query/queries/QueryTest/admission-max-min-mem-limits.test
index 7e1ff107f..c38ec124d 100644
--- 
a/testdata/workloads/functional-query/queries/QueryTest/admission-max-min-mem-limits.test
+++ 
b/testdata/workloads/functional-query/queries/QueryTest/admission-max-min-mem-limits.test
@@ -19,8 +19,8 @@ row_regex: .*Cluster Memory Admitted: 68.00 MB.*
 set request_pool=poolLowMinLimit;
 select * from functional_parquet.alltypes limit 1;
 ---- RUNTIME_PROFILE
-row_regex: .*Per-Host Resource Estimates: Memory=20MB.*
-row_regex: .*Cluster Memory Admitted: 36.09 MB.*
+row_regex: .*Per-Host Resource Estimates: Memory=16MB.*
+row_regex: .*Cluster Memory Admitted: 32.09 MB.*
 ====
 ---- QUERY
 # No mem_limit set
@@ -32,9 +32,9 @@ select * from functional_parquet.alltypes limit 1;
 ---- CATCH
 Rejected query from pool root.poolLowMaxLimit: minimum memory reservation is 
greater than
  memory available to the query for buffer reservations. Memory reservation 
needed given
- the current plan: 4.09 MB. Adjust either the mem_limit or the pool config
+ the current plan: 88.00 KB. Adjust either the mem_limit or the pool config
  (max-query-mem-limit, min-query-mem-limit) for the query to allow the query
- memory limit to be at least 36.09 MB. Note that changing the mem_limit may 
also change
+ memory limit to be at least 32.09 MB. Note that changing the mem_limit may 
also change
  the plan. See the query profile for more information about the per-node memory
  requirements.
 ====
@@ -92,9 +92,9 @@ select * from functional_parquet.alltypes limit 1;
 ---- CATCH
 Rejected query from pool root.poolLowMinLimit: minimum memory reservation is 
greater than
  memory available to the query for buffer reservations. Memory reservation 
needed given
- the current plan: 4.09 MB. Adjust either the mem_limit or the pool config
+ the current plan: 88.00 KB. Adjust either the mem_limit or the pool config
  (max-query-mem-limit, min-query-mem-limit) for the query to allow the query
- memory limit to be at least 36.09 MB. Note that changing the mem_limit may 
also change
+ memory limit to be at least 32.09 MB. Note that changing the mem_limit may 
also change
  the plan. See the query profile for more information about the per-node memory
  requirements.
 ====
diff --git 
a/testdata/workloads/functional-query/queries/QueryTest/dedicated-coord-mem-estimates.test
 
b/testdata/workloads/functional-query/queries/QueryTest/dedicated-coord-mem-estimates.test
index f7ee61dc2..5a3d65bcf 100644
--- 
a/testdata/workloads/functional-query/queries/QueryTest/dedicated-coord-mem-estimates.test
+++ 
b/testdata/workloads/functional-query/queries/QueryTest/dedicated-coord-mem-estimates.test
@@ -47,9 +47,9 @@ row_regex: .*Cluster Memory Admitted: 145.47 MB.*
 # SELECT with a non-grouping aggregate in the coordinator fragment.
 select avg(int_col) from functional.alltypes;
 ---- RUNTIME_PROFILE
-row_regex: .*Per-Host Resource Estimates: Memory=20MB.*
-row_regex: .*Dedicated Coordinator Resource Estimate: Memory=104MB.*
-row_regex: .*Cluster Memory Admitted: 144.08 MB.*
+row_regex: .*Per-Host Resource Estimates: Memory=16MB.*
+row_regex: .*Dedicated Coordinator Resource Estimate: Memory=100MB.*
+row_regex: .*Cluster Memory Admitted: 132.12 MB.*
 ====
 ---- QUERY
 # SELECT with num_nodes=1 and a complex plan in the coordinator.
diff --git 
a/testdata/workloads/functional-query/queries/QueryTest/explain-level2.test 
b/testdata/workloads/functional-query/queries/QueryTest/explain-level2.test
index d65e4f6d1..5ffcd130e 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/explain-level2.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/explain-level2.test
@@ -67,7 +67,7 @@ from functional_avro.alltypes t1
   left outer join functional_avro.alltypes t3 on (t2.id = t3.id)
 where t1.month = 1 and t2.year = 2009 and t3.bool_col = false
 ---- RESULTS: VERIFY_IS_SUBSET
-'Per-Host Resource Estimates: Memory=58MB'
+'Per-Host Resource Estimates: Memory=54MB'
 'WARNING: The following tables are missing relevant table and/or column 
statistics.'
 'functional_avro.alltypes, functional_parquet.alltypessmall'
 ====
diff --git a/tests/query_test/test_observability.py 
b/tests/query_test/test_observability.py
index a5721b78f..f68f98f32 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -180,7 +180,8 @@ class TestObservability(ImpalaTestSuite):
         "NUM_NODES=1,NUM_SCANNER_THREADS=1,"
         "RUNTIME_FILTER_MODE=OFF,MT_DOP=0,{erasure_coding}TIMEZONE={timezone},"
         "CLIENT_IDENTIFIER="
-        
"query_test/test_observability.py::TestObservability::()::test_query_options"
+        
"query_test/test_observability.py::TestObservability::()::test_query_options,"
+        "SPOOL_QUERY_RESULTS=0"
         "\n")
     expected_str = expected_str.format(
         erasure_coding="ALLOW_ERASURE_CODED_FILES=1," if IS_EC else "",

Reply via email to