http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
----------------------------------------------------------------------
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
index d3abe16..2adecc3 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
@@ -1,7 +1,7 @@
 # Rows per node is < 3000: codegen should be disabled.
 select count(*) from functional.alltypes
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=32.00KB
+Max Per-Host Resource Reservation: Memory=32.00KB Threads=3
 Per-Host Resource Estimates: Memory=148.00MB
 Codegen disabled by planner
 
@@ -21,7 +21,7 @@ PLAN-ROOT SINK
 # Rows per node is > 3000: codegen should be enabled.
 select count(*) from functional.alltypesagg
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=128.00KB
+Max Per-Host Resource Reservation: Memory=128.00KB Threads=3
 Per-Host Resource Estimates: Memory=100.00MB
 
 PLAN-ROOT SINK
@@ -40,7 +40,7 @@ PLAN-ROOT SINK
 # No stats on functional_parquet: codegen should be disabled.
 select count(*) from functional_parquet.alltypes
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=16.00KB
+Max Per-Host Resource Reservation: Memory=16.00KB Threads=3
 Per-Host Resource Estimates: Memory=21.00MB
 WARNING: The following tables are missing relevant table and/or column 
statistics.
 functional_parquet.alltypes
@@ -61,7 +61,7 @@ PLAN-ROOT SINK
 # > 3000 rows returned to coordinator: codegen should be enabled
 select * from functional_parquet.alltypes
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=88.00KB
+Max Per-Host Resource Reservation: Memory=88.00KB Threads=3
 Per-Host Resource Estimates: Memory=128.00MB
 WARNING: The following tables are missing relevant table and/or column 
statistics.
 functional_parquet.alltypes
@@ -78,7 +78,7 @@ select count(*)
 from functional.alltypes t1
 join functional.alltypestiny t2 on t1.id = t2.id
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=2.98MB
+Max Per-Host Resource Reservation: Memory=2.98MB Threads=5
 Per-Host Resource Estimates: Memory=182.94MB
 Codegen disabled by planner
 
@@ -108,7 +108,7 @@ PLAN-ROOT SINK
 # Optimisation is disabled by cross join producing > 3000 rows
 select count(*) from functional.alltypes t1, functional.alltypes t2
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=64.00KB
+Max Per-Host Resource Reservation: Memory=64.00KB Threads=5
 Per-Host Resource Estimates: Memory=276.00MB
 
 PLAN-ROOT SINK
@@ -137,7 +137,7 @@ select count(*) from (
   union all
   select * from functional.alltypestiny) v
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=32.00KB
+Max Per-Host Resource Reservation: Memory=32.00KB Threads=3
 Per-Host Resource Estimates: Memory=148.00MB
 Codegen disabled by planner
 
@@ -166,7 +166,7 @@ select count(*) from (
   union all
   select * from functional.alltypes) v
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=32.00KB
+Max Per-Host Resource Reservation: Memory=32.00KB Threads=3
 Per-Host Resource Estimates: Memory=148.00MB
 
 PLAN-ROOT SINK
@@ -193,7 +193,7 @@ PLAN-ROOT SINK
 select sum(l_discount)
 from (select * from tpch.lineitem limit 1000) v
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=8.00MB
+Max Per-Host Resource Reservation: Memory=8.00MB Threads=3
 Per-Host Resource Estimates: Memory=274.00MB
 Codegen disabled by planner
 
@@ -214,7 +214,7 @@ PLAN-ROOT SINK
 select sum(l_discount)
 from (select * from tpch.lineitem where l_orderkey > 100 limit 1000) v
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=8.00MB
+Max Per-Host Resource Reservation: Memory=8.00MB Threads=3
 Per-Host Resource Estimates: Memory=274.00MB
 
 PLAN-ROOT SINK

http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
----------------------------------------------------------------------
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 29896c7..1a2bfe8 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
@@ -5,15 +5,15 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=185.50MB mem-reservation=25.50MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=185.50MB mem-reservation=25.50MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_customer_sk = c_customer_sk
 |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
 |  runtime filters: RF000[bloom] <- c_customer_sk
-|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=355B cardinality=529700
 |
 |--01:SCAN HDFS [tpcds.customer]
@@ -24,7 +24,7 @@ PLAN-ROOT SINK
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
 |     parquet dictionary predicates: c_salutation = 'Mrs.'
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=255B cardinality=16667
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -34,8 +34,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # Single-column FK/PK join detection on left outer join. The join cardinality
@@ -46,15 +46,15 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=184.50MB mem-reservation=24.50MB
+|  Per-Host Resources: mem-estimate=184.50MB mem-reservation=24.50MB 
thread-reservation=3
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [LEFT OUTER JOIN]
 |  hash predicates: ss_customer_sk = c_customer_sk
 |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
 |  other predicates: c_salutation = 'Mrs.'
-|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB 
thread-reservation=0
 |  tuple-ids=0,1N row-size=355B cardinality=2880404
 |
 |--01:SCAN HDFS [tpcds.customer]
@@ -65,7 +65,7 @@ PLAN-ROOT SINK
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
 |     parquet dictionary predicates: c_salutation = 'Mrs.'
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=255B cardinality=16667
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -74,8 +74,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # Single-column FK/PK join detection on right outer join. The join cardinality
@@ -86,15 +86,15 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=185.50MB mem-reservation=25.50MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=185.50MB mem-reservation=25.50MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [RIGHT OUTER JOIN]
 |  hash predicates: ss_customer_sk = c_customer_sk
 |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
 |  runtime filters: RF000[bloom] <- c_customer_sk
-|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB 
thread-reservation=0
 |  tuple-ids=0N,1 row-size=355B cardinality=529700
 |
 |--01:SCAN HDFS [tpcds.customer]
@@ -105,7 +105,7 @@ PLAN-ROOT SINK
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
 |     parquet dictionary predicates: c_salutation = 'Mrs.'
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=255B cardinality=16667
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -115,8 +115,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # Multi-column FK/PK join detection
@@ -126,15 +126,15 @@ on ss_item_sk = sr_item_sk and ss_ticket_number = 
sr_ticket_number
 where sr_return_quantity < 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=214.75MB mem-reservation=22.75MB 
runtime-filters-memory=2.00MB
+|  Per-Host Resources: mem-estimate=214.75MB mem-reservation=22.75MB 
thread-reservation=3 runtime-filters-memory=2.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  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: RF000[bloom] <- sr_item_sk, RF001[bloom] <- 
sr_ticket_number
-|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=188B cardinality=211838
 |
 |--01:SCAN HDFS [tpcds.store_returns]
@@ -145,7 +145,7 @@ PLAN-ROOT SINK
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=287514
 |     parquet dictionary predicates: sr_return_quantity < 10
-|     mem-estimate=80.00MB mem-reservation=8.00MB
+|     mem-estimate=80.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=88B cardinality=28751
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -155,8 +155,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # Many-to-many join detection.
@@ -165,15 +165,15 @@ tpcds.store_sales inner join tpcds.web_sales
 on ss_sold_time_sk = ws_sold_time_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=397.67MB mem-reservation=51.00MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=397.67MB mem-reservation=51.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_sold_time_sk = ws_sold_time_sk
 |  fk/pk conjuncts: none
 |  runtime filters: RF000[bloom] <- ws_sold_time_sk
-|  mem-estimate=108.67MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=108.67MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=244B cardinality=44136418
 |
 |--01:SCAN HDFS [tpcds.web_sales]
@@ -182,7 +182,7 @@ PLAN-ROOT SINK
 |       table: rows=719384 size=140.07MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=657377
-|     mem-estimate=160.00MB mem-reservation=8.00MB
+|     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=144B cardinality=719384
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -192,8 +192,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # PK/PK join is detected as FK/PK.
@@ -203,15 +203,15 @@ on a.d_date_sk = b.d_date_sk
 where a.d_holiday = "Y"
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=114.00MB mem-reservation=34.00MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=114.00MB mem-reservation=34.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: b.d_date_sk = a.d_date_sk
 |  fk/pk conjuncts: b.d_date_sk = a.d_date_sk
 |  runtime filters: RF000[bloom] <- a.d_date_sk
-|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB 
thread-reservation=0
 |  tuple-ids=1,0 row-size=606B cardinality=36525
 |
 |--00:SCAN HDFS [tpcds.date_dim a]
@@ -222,7 +222,7 @@ PLAN-ROOT SINK
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=73049
 |     parquet dictionary predicates: a.d_holiday = 'Y'
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=0 row-size=303B cardinality=36525
 |
 01:SCAN HDFS [tpcds.date_dim b]
@@ -232,7 +232,7 @@ PLAN-ROOT SINK
      table: rows=73049 size=9.84MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=73049
-   mem-estimate=48.00MB mem-reservation=8.00MB
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=1 row-size=303B cardinality=73049
 ====
 # Single query with various join types combined.
@@ -246,15 +246,15 @@ where ss_item_sk = sr_item_sk and ss_ticket_number = 
sr_ticket_number
   and d1.d_fy_week_seq = 1000
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=362.81MB mem-reservation=50.81MB 
runtime-filters-memory=5.00MB
+|  Per-Host Resources: mem-estimate=362.81MB mem-reservation=50.81MB 
thread-reservation=6 runtime-filters-memory=5.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 08:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_addr_sk = c_current_addr_sk
 |  fk/pk conjuncts: none
 |  runtime filters: RF000[bloom] <- c_current_addr_sk
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=1,0,3,4,2 row-size=60B cardinality=19358
 |
 |--02:SCAN HDFS [tpcds.customer]
@@ -263,14 +263,14 @@ PLAN-ROOT SINK
 |       table: rows=100000 size=12.60MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=2 row-size=4B cardinality=100000
 |
 07:HASH JOIN [INNER JOIN]
 |  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=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=1,0,3,4 row-size=56B cardinality=8131
 |
 |--04:SCAN HDFS [tpcds.date_dim d2]
@@ -279,21 +279,21 @@ PLAN-ROOT SINK
 |       table: rows=73049 size=9.84MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=73049
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=4 row-size=4B cardinality=73049
 |
 06:HASH JOIN [INNER JOIN]
 |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = 
ss_ticket_number
 |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = 
ss_ticket_number
 |  runtime filters: RF004[bloom] <- ss_item_sk, RF005[bloom] <- 
ss_ticket_number
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=1,0,3 row-size=52B cardinality=8131
 |
 |--05:HASH JOIN [INNER JOIN]
 |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
 |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
 |  |  runtime filters: RF008[bloom] <- d1.d_date_sk
-|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  |  tuple-ids=0,3 row-size=32B cardinality=11055
 |  |
 |  |--03:SCAN HDFS [tpcds.date_dim d1]
@@ -304,7 +304,7 @@ PLAN-ROOT SINK
 |  |       columns: all
 |  |     extrapolated-rows=disabled max-scan-range-rows=73049
 |  |     parquet dictionary predicates: d1.d_fy_week_seq = 1000
-|  |     mem-estimate=48.00MB mem-reservation=8.00MB
+|  |     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |  |     tuple-ids=3 row-size=8B cardinality=7
 |  |
 |  00:SCAN HDFS [tpcds.store_sales]
@@ -314,8 +314,8 @@ PLAN-ROOT SINK
 |       table: rows=2880404 size=346.60MB
 |       partitions: 1824/1824 rows=2880404
 |       columns: all
-|     extrapolated-rows=disabled max-scan-range-rows=83798
-|     mem-estimate=128.00MB mem-reservation=8.00MB
+|     extrapolated-rows=disabled max-scan-range-rows=130093
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=0 row-size=24B cardinality=2880404
 |
 01:SCAN HDFS [tpcds.store_returns]
@@ -325,7 +325,7 @@ PLAN-ROOT SINK
      table: rows=287514 size=31.19MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=287514
-   mem-estimate=80.00MB mem-reservation=8.00MB
+   mem-estimate=80.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=1 row-size=20B cardinality=287514
 ====
 # Assumed FK/PK join becasue of non-trivial equi-join exprs.
@@ -334,15 +334,15 @@ tpcds.store_sales inner join tpcds.customer
 on ss_customer_sk % 10 = c_customer_sk / 100
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=211.00MB mem-reservation=51.00MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=211.00MB mem-reservation=51.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_customer_sk % 10 = c_customer_sk / 100
 |  fk/pk conjuncts: assumed fk/pk
 |  runtime filters: RF000[bloom] <- c_customer_sk / 100
-|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=355B cardinality=2880404
 |
 |--01:SCAN HDFS [tpcds.customer]
@@ -351,7 +351,7 @@ PLAN-ROOT SINK
 |       table: rows=100000 size=12.60MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=255B cardinality=100000
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -361,8 +361,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====
 # Assumed FK/PK join due to missing stats on the rhs. Join cardinality is 
equal to
@@ -372,15 +372,15 @@ tpcds.store_sales inner join tpcds_seq_snap.customer
 on ss_customer_sk = c_customer_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=2.17GB mem-reservation=51.00MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=2.17GB mem-reservation=51.00MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_customer_sk = c_customer_sk
 |  fk/pk conjuncts: assumed fk/pk
 |  runtime filters: RF000[bloom] <- c_customer_sk
-|  mem-estimate=2.00GB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=2.00GB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=8B cardinality=2880404
 |
 |--01:SCAN HDFS [tpcds_seq_snap.customer]
@@ -389,7 +389,7 @@ PLAN-ROOT SINK
 |       table: rows=unavailable size=8.58MB
 |       columns: unavailable
 |     extrapolated-rows=disabled max-scan-range-rows=unavailable
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=4B cardinality=unavailable
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -399,8 +399,8 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=4B cardinality=2880404
 ====
 # Assumed FK/PK join due to missing stats on the lhs. Join cardinality is 
unknown.
@@ -409,15 +409,15 @@ tpcds_seq_snap.store_sales inner join tpcds.customer
 on ss_customer_sk = c_customer_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=178.94MB mem-reservation=18.94MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=178.94MB mem-reservation=18.94MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_customer_sk = c_customer_sk
 |  fk/pk conjuncts: assumed fk/pk
 |  runtime filters: RF000[bloom] <- c_customer_sk
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=8B cardinality=unavailable
 |
 |--01:SCAN HDFS [tpcds.customer]
@@ -426,7 +426,7 @@ PLAN-ROOT SINK
 |       table: rows=100000 size=12.60MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=100000
-|     mem-estimate=48.00MB mem-reservation=8.00MB
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=4B cardinality=100000
 |
 00:SCAN HDFS [tpcds_seq_snap.store_sales]
@@ -437,7 +437,7 @@ PLAN-ROOT SINK
      partitions: 0/1824 rows=unavailable
      columns: unavailable
    extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=4B cardinality=unavailable
 ====
 # Join is detected as many-to-many even though the rhs join columns
@@ -448,20 +448,20 @@ tpcds.store_sales inner join
 on ss_sold_time_sk = ws_sold_time_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=299.00MB mem-reservation=18.94MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=299.00MB mem-reservation=18.94MB 
thread-reservation=3 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:HASH JOIN [INNER JOIN]
 |  hash predicates: ss_sold_time_sk = ws_sold_time_sk
 |  fk/pk conjuncts: none
 |  runtime filters: RF000[bloom] <- ws_sold_time_sk
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,2 row-size=104B cardinality=2440073
 |
 |--02:AGGREGATE [FINALIZE]
 |  |  group by: ws_sold_time_sk
-|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  |  tuple-ids=2 row-size=4B cardinality=39771
 |  |
 |  01:SCAN HDFS [tpcds.web_sales]
@@ -470,7 +470,7 @@ PLAN-ROOT SINK
 |       table: rows=719384 size=140.07MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=657377
-|     mem-estimate=160.00MB mem-reservation=8.00MB
+|     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=4B cardinality=719384
 |
 00:SCAN HDFS [tpcds.store_sales]
@@ -480,7 +480,7 @@ PLAN-ROOT SINK
      table: rows=2880404 size=346.60MB
      partitions: 1824/1824 rows=2880404
      columns: all
-   extrapolated-rows=disabled max-scan-range-rows=83798
-   mem-estimate=128.00MB mem-reservation=8.00MB
+   extrapolated-rows=disabled max-scan-range-rows=130093
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=100B cardinality=2880404
 ====

http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
----------------------------------------------------------------------
diff --git 
a/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
 
b/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
index cf3014f..cf7dfe6 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
@@ -1,124 +1,124 @@
 select * from functional_kudu.zipcode_incomes where id = '8600000US00601'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      kudu predicates: id = '8600000US00601'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=1
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   01:EXCHANGE [UNPARTITIONED]
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=0
      tuple-ids=0 row-size=124B cardinality=1
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      kudu predicates: id = '8600000US00601'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=1
 ====
 # The cardinality from "zip = '2'" should dominate.
 select * from functional_kudu.zipcode_incomes where id != '1' and zip = '2'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      predicates: id != '1'
      kudu predicates: zip = '2'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=1
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   01:EXCHANGE [UNPARTITIONED]
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=0
      tuple-ids=0 row-size=124B cardinality=1
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      predicates: id != '1'
      kudu predicates: zip = '2'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=1
 ====
 select * from functional_kudu.zipcode_incomes where id > '1' and zip > '2'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      kudu predicates: zip > '2', id > '1'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=3317
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   01:EXCHANGE [UNPARTITIONED]
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=0
      tuple-ids=0 row-size=124B cardinality=3317
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      kudu predicates: zip > '2', id > '1'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=3317
 ====
 select * from functional_kudu.zipcode_incomes where id = '1' or id = '2' or 
zip = '3'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      predicates: id IN ('1', '2') OR zip = '3'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=3
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   01:EXCHANGE [UNPARTITIONED]
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=0
      tuple-ids=0 row-size=124B cardinality=3
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
      predicates: id IN ('1', '2') OR zip = '3'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=124B cardinality=3
 ====
 # Test alltypes in-list predicates.
@@ -147,27 +147,27 @@ string_col not in ("bar") and
 id in (int_col)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.alltypes]
      predicates: id IN (int_col), bigint_col IN (9999999999999999999), 
double_col IN (CAST('inf' AS DOUBLE)), float_col IN (CAST('NaN' AS FLOAT)), 
int_col IN (9999999999), smallint_col IN (99999, 2), tinyint_col IN (1, 999), 
bool_col IN (1), string_col NOT IN ('bar')
      kudu predicates: double_col IN (0.0), float_col IN (0.0), bigint_col IN 
(1, 2), int_col IN (1, 2), smallint_col IN (0, 2), string_col IN ('foo', 'foo   
    '), tinyint_col IN (1, 2), bool_col IN (TRUE)
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=97B cardinality=5
 ====
 # Test decimal in-list predicates.
 select * from functional_kudu.decimal_tbl where d1 in (1234, 12345);
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.decimal_tbl]
      kudu predicates: d1 IN (1234, 12345)
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=56B cardinality=2
 ====
 select * from functional_kudu.alltypes where
@@ -178,14 +178,14 @@ timestamp_col > (nanoseconds_add(cast('1987-05-19 
00:00:00' as timestamp), 10))
 timestamp_col < (seconds_add(cast('9999-12-31 24:59:59' as timestamp), 10))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.alltypes]
      predicates: CAST(date_string_col AS TINYINT) IS NULL, timestamp_col < NULL
      kudu predicates: smallint_col IS NULL, tinyint_col IS NOT NULL, 
timestamp_col > TIMESTAMP '1987-05-19 00:00:00.000000010'
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=97B cardinality=730
 ====
 select * from functional_kudu.alltypes where
@@ -193,13 +193,13 @@ timestamp_col in (cast('2010-03-01 00:00:00' as 
timestamp),
                   cast('2010-03-01 00:01:00' as timestamp))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.alltypes]
      kudu predicates: timestamp_col IN (TIMESTAMP '2010-03-01 00:00:00', 
TIMESTAMP '2010-03-01 00:01:00')
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=97B cardinality=1
 ====
 select * from functional_kudu.alltypes where
@@ -208,12 +208,12 @@ timestamp_col in (cast('2010-03-01 00:00:00' as 
timestamp),
                   cast('2010-03-01 00:01:00' as timestamp))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-Per-Host Resources: mem-estimate=0B mem-reservation=0B
+Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=2
   PLAN-ROOT SINK
-  |  mem-estimate=0B mem-reservation=0B
+  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
   |
   00:SCAN KUDU [functional_kudu.alltypes]
      predicates: timestamp_col IN (TIMESTAMP '2010-03-01 00:00:00', NULL, 
TIMESTAMP '2010-03-01 00:01:00')
-     mem-estimate=0B mem-reservation=0B
+     mem-estimate=0B mem-reservation=0B thread-reservation=1
      tuple-ids=0 row-size=97B cardinality=3
 ====

http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
----------------------------------------------------------------------
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 6bc22c9..cec6162 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/max-row-size.test
@@ -4,40 +4,40 @@ select straight_join *
 from tpch_parquet.customer
     inner join tpch_parquet.nation on c_nationkey = n_nationkey
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=33.97MB
+Max Per-Host Resource Reservation: Memory=33.97MB Threads=5
 Per-Host Resource Estimates: Memory=57.94MB
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0,1 row-size=355B cardinality=150000
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-Per-Host Resources: mem-estimate=41.94MB mem-reservation=33.94MB 
runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=41.94MB mem-reservation=33.94MB 
thread-reservation=2 runtime-filters-memory=1.00MB
 02:HASH JOIN [INNER JOIN, BROADCAST]
 |  hash predicates: c_nationkey = n_nationkey
 |  fk/pk conjuncts: c_nationkey = n_nationkey
 |  runtime filters: RF000[bloom] <- n_nationkey
-|  mem-estimate=16.94MB mem-reservation=16.94MB spill-buffer=64.00KB
+|  mem-estimate=16.94MB mem-reservation=16.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=355B cardinality=150000
 |
 |--03:EXCHANGE [BROADCAST]
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1 row-size=117B cardinality=25
 |  |
 |  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB 
thread-reservation=2
 |  01:SCAN HDFS [tpch_parquet.nation, RANDOM]
 |     partitions=1/1 files=1 size=2.75KB
 |     stored statistics:
 |       table: rows=25 size=2.75KB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=25
-|     mem-estimate=16.00MB mem-reservation=32.00KB
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
 |     tuple-ids=1 row-size=117B cardinality=25
 |
 00:SCAN HDFS [tpch_parquet.customer, RANDOM]
@@ -47,7 +47,7 @@ Per-Host Resources: mem-estimate=41.94MB 
mem-reservation=33.94MB runtime-filters
      table: rows=150000 size=12.31MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=150000
-   mem-estimate=24.00MB mem-reservation=16.00MB
+   mem-estimate=24.00MB mem-reservation=16.00MB thread-reservation=1
    tuple-ids=0 row-size=238B cardinality=150000
 ====
 # Join with large build side.
@@ -56,39 +56,39 @@ select straight_join *
 from tpch_parquet.lineitem
     left join tpch_parquet.orders on l_orderkey = o_orderkey
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=110.00MB
+Max Per-Host Resource Reservation: Memory=110.00MB Threads=5
 Per-Host Resource Estimates: Memory=420.41MB
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0,1N row-size=454B cardinality=6001215
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=380.41MB mem-reservation=86.00MB
+Per-Host Resources: mem-estimate=380.41MB 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=300.41MB mem-reservation=46.00MB spill-buffer=2.00MB
+|  mem-estimate=300.41MB mem-reservation=46.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=0,1N row-size=454B cardinality=6001215
 |
 |--03:EXCHANGE [BROADCAST]
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1 row-size=191B cardinality=1500000
 |  |
 |  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=24.00MB
+|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=24.00MB 
thread-reservation=2
 |  01:SCAN HDFS [tpch_parquet.orders, RANDOM]
 |     partitions=1/1 files=2 size=54.07MB
 |     stored statistics:
 |       table: rows=1500000 size=54.07MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=1177135
-|     mem-estimate=40.00MB mem-reservation=24.00MB
+|     mem-estimate=40.00MB mem-reservation=24.00MB thread-reservation=1
 |     tuple-ids=1 row-size=191B cardinality=1500000
 |
 00:SCAN HDFS [tpch_parquet.lineitem, RANDOM]
@@ -97,7 +97,7 @@ Per-Host Resources: mem-estimate=380.41MB 
mem-reservation=86.00MB
      table: rows=6001215 size=193.71MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=2141802
-   mem-estimate=80.00MB mem-reservation=40.00MB
+   mem-estimate=80.00MB mem-reservation=40.00MB thread-reservation=1
    tuple-ids=0 row-size=263B cardinality=6001215
 ====
 # Null-aware anti-join with medium build side.
@@ -105,38 +105,38 @@ Per-Host Resources: mem-estimate=380.41MB 
mem-reservation=86.00MB
 select * from tpch_parquet.lineitem
 where l_orderkey not in (select o_orderkey from tpch_parquet.orders)
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=78.00MB
+Max Per-Host Resource Reservation: Memory=78.00MB Threads=5
 Per-Host Resource Estimates: Memory=154.00MB
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0 row-size=263B cardinality=6001215
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=114.00MB mem-reservation=74.00MB
+Per-Host Resources: mem-estimate=114.00MB mem-reservation=74.00MB 
thread-reservation=2
 02:HASH JOIN [NULL AWARE LEFT ANTI JOIN, BROADCAST]
 |  hash predicates: l_orderkey = o_orderkey
-|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=1.00MB 
thread-reservation=0
 |  tuple-ids=0 row-size=263B cardinality=6001215
 |
 |--03:EXCHANGE [BROADCAST]
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1 row-size=8B cardinality=1500000
 |  |
 |  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=4.00MB
+|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=4.00MB 
thread-reservation=2
 |  01:SCAN HDFS [tpch_parquet.orders, RANDOM]
 |     partitions=1/1 files=2 size=54.07MB
 |     stored statistics:
 |       table: rows=1500000 size=54.07MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=1177135
-|     mem-estimate=40.00MB mem-reservation=4.00MB
+|     mem-estimate=40.00MB mem-reservation=4.00MB thread-reservation=1
 |     tuple-ids=1 row-size=8B cardinality=1500000
 |
 00:SCAN HDFS [tpch_parquet.lineitem, RANDOM]
@@ -145,7 +145,7 @@ Per-Host Resources: mem-estimate=114.00MB 
mem-reservation=74.00MB
      table: rows=6001215 size=193.71MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=2141802
-   mem-estimate=80.00MB mem-reservation=40.00MB
+   mem-estimate=80.00MB mem-reservation=40.00MB thread-reservation=1
    tuple-ids=0 row-size=263B cardinality=6001215
 ====
 # Mid NDV aggregation.
@@ -156,67 +156,67 @@ from tpch_parquet.lineitem
 group by 1, 2
 having count(*) = 1
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=125.00MB
+Max Per-Host Resource Reservation: Memory=125.00MB Threads=7
 Per-Host Resource Estimates: Memory=253.12MB
 
 F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 08:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2 row-size=33B cardinality=4690314
 |
 F03:PLAN FRAGMENT [HASH(l_orderkey,o_orderstatus)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=46.00MB mem-reservation=46.00MB
+Per-Host Resources: mem-estimate=46.00MB mem-reservation=46.00MB 
thread-reservation=1
 07:AGGREGATE [FINALIZE]
 |  output: count:merge(*)
 |  group by: l_orderkey, o_orderstatus
 |  having: count(*) = 1
-|  mem-estimate=46.00MB mem-reservation=46.00MB spill-buffer=2.00MB
+|  mem-estimate=46.00MB mem-reservation=46.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=2 row-size=33B cardinality=4690314
 |
 06:EXCHANGE [HASH(l_orderkey,o_orderstatus)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2 row-size=33B cardinality=4690314
 |
 F02:PLAN FRAGMENT [HASH(l_orderkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=86.12MB mem-reservation=66.00MB 
runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=86.12MB mem-reservation=66.00MB 
thread-reservation=1 runtime-filters-memory=1.00MB
 03:AGGREGATE [STREAMING]
 |  output: count(*)
 |  group by: l_orderkey, o_orderstatus
-|  mem-estimate=54.12MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=54.12MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=2 row-size=33B cardinality=4690314
 |
 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=31.00MB mem-reservation=31.00MB spill-buffer=1.00MB
+|  mem-estimate=31.00MB mem-reservation=31.00MB spill-buffer=1.00MB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=33B cardinality=5757710
 |
 |--05:EXCHANGE [HASH(o_orderkey)]
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1 row-size=25B cardinality=1500000
 |  |
 |  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
-|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=8.00MB
+|  Per-Host Resources: mem-estimate=40.00MB mem-reservation=8.00MB 
thread-reservation=2
 |  01:SCAN HDFS [tpch_parquet.orders, RANDOM]
 |     partitions=1/1 files=2 size=54.07MB
 |     stored statistics:
 |       table: rows=1500000 size=54.07MB
 |       columns: all
 |     extrapolated-rows=disabled max-scan-range-rows=1177135
-|     mem-estimate=40.00MB mem-reservation=8.00MB
+|     mem-estimate=40.00MB mem-reservation=8.00MB thread-reservation=1
 |     tuple-ids=1 row-size=25B cardinality=1500000
 |
 04:EXCHANGE [HASH(l_orderkey)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0 row-size=8B cardinality=6001215
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=81.00MB mem-reservation=5.00MB 
runtime-filters-memory=1.00MB
+Per-Host Resources: mem-estimate=81.00MB mem-reservation=5.00MB 
thread-reservation=2 runtime-filters-memory=1.00MB
 00:SCAN HDFS [tpch_parquet.lineitem, RANDOM]
    partitions=1/1 files=3 size=193.71MB
    runtime filters: RF000[bloom] -> l_orderkey
@@ -224,7 +224,7 @@ Per-Host Resources: mem-estimate=81.00MB 
mem-reservation=5.00MB runtime-filters-
      table: rows=6001215 size=193.71MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=2141802
-   mem-estimate=80.00MB mem-reservation=4.00MB
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
    tuple-ids=0 row-size=8B cardinality=6001215
 ====
 # High NDV aggregation.
@@ -232,34 +232,34 @@ Per-Host Resources: mem-estimate=81.00MB 
mem-reservation=5.00MB runtime-filters-
 select distinct *
 from tpch_parquet.lineitem
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=120.00MB
+Max Per-Host Resource Reservation: Memory=120.00MB Threads=4
 Per-Host Resource Estimates: Memory=3.31GB
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1 row-size=263B cardinality=6001215
 |
 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_shipinstruct,tpch_parquet.lineitem.l_shipmode,tpch_parquet.lineitem.l_comment)]
 hosts=3 instances=3
-Per-Host Resources: mem-estimate=1.62GB mem-reservation=46.00MB
+Per-Host Resources: mem-estimate=1.62GB 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_shipinstruct, tpch_parquet.lineitem.l_shipmode, 
tpch_parquet.lineitem.l_comment
-|  mem-estimate=1.62GB mem-reservation=46.00MB spill-buffer=2.00MB
+|  mem-estimate=1.62GB mem-reservation=46.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=263B cardinality=6001215
 |
 02:EXCHANGE 
[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_shipinstruct,tpch_parquet.lineitem.l_shipmode,tpch_parquet.lineitem.l_comment)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1 row-size=263B cardinality=6001215
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=1.69GB mem-reservation=74.00MB
+Per-Host Resources: mem-estimate=1.69GB 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_shipinstruct, tpch_parquet.lineitem.l_shipmode, 
tpch_parquet.lineitem.l_comment
-|  mem-estimate=1.62GB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=1.62GB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=263B cardinality=6001215
 |
 00:SCAN HDFS [tpch_parquet.lineitem, RANDOM]
@@ -268,7 +268,7 @@ Per-Host Resources: mem-estimate=1.69GB 
mem-reservation=74.00MB
      table: rows=6001215 size=193.71MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=2141802
-   mem-estimate=80.00MB mem-reservation=40.00MB
+   mem-estimate=80.00MB mem-reservation=40.00MB thread-reservation=1
    tuple-ids=0 row-size=263B cardinality=6001215
 ====
 # High NDV aggregation with string aggregation function.
@@ -277,36 +277,36 @@ select l_orderkey, l_partkey, group_concat(l_linestatus, 
",")
 from tpch_parquet.lineitem
 group by 1, 2
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=98.00MB
+Max Per-Host Resource Reservation: Memory=98.00MB Threads=4
 Per-Host Resource Estimates: Memory=482.91MB
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1 row-size=32B cardinality=6001215
 |
 F01:PLAN FRAGMENT [HASH(l_orderkey,l_partkey)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=201.46MB mem-reservation=48.00MB
+Per-Host Resources: mem-estimate=201.46MB mem-reservation=48.00MB 
thread-reservation=1
 03:AGGREGATE [FINALIZE]
 |  output: group_concat:merge(l_linestatus, ',')
 |  group by: l_orderkey, l_partkey
-|  mem-estimate=201.46MB mem-reservation=48.00MB spill-buffer=2.00MB
+|  mem-estimate=201.46MB mem-reservation=48.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=32B cardinality=6001215
 |
 02:EXCHANGE [HASH(l_orderkey,l_partkey)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1 row-size=32B cardinality=6001215
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=281.46MB mem-reservation=50.00MB
+Per-Host Resources: mem-estimate=281.46MB mem-reservation=50.00MB 
thread-reservation=2
 01:AGGREGATE [STREAMING]
 |  output: group_concat(l_linestatus, ',')
 |  group by: l_orderkey, l_partkey
-|  mem-estimate=201.46MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=201.46MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=32B cardinality=6001215
 |
 00:SCAN HDFS [tpch_parquet.lineitem, RANDOM]
@@ -315,7 +315,7 @@ Per-Host Resources: mem-estimate=281.46MB 
mem-reservation=50.00MB
      table: rows=6001215 size=193.71MB
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=2141802
-   mem-estimate=80.00MB mem-reservation=16.00MB
+   mem-estimate=80.00MB mem-reservation=16.00MB thread-reservation=1
    tuple-ids=0 row-size=33B cardinality=6001215
 ====
 # Sort + Analytic.
@@ -323,38 +323,38 @@ Per-Host Resources: mem-estimate=281.46MB 
mem-reservation=50.00MB
 select max(tinyint_col) over(partition by int_col)
 from functional.alltypes
 ---- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=40.03MB
+Max Per-Host Resource Reservation: Memory=40.03MB Threads=4
 Per-Host Resource Estimates: Memory=56.00MB
 Codegen disabled by planner
 
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=3,2 row-size=6B cardinality=7300
 |
 F01:PLAN FRAGMENT [HASH(int_col)] hosts=3 instances=3
-Per-Host Resources: mem-estimate=40.00MB mem-reservation=40.00MB
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=40.00MB 
thread-reservation=1
 02:ANALYTIC
 |  functions: max(tinyint_col)
 |  partition by: int_col
-|  mem-estimate=16.00MB mem-reservation=16.00MB spill-buffer=8.00MB
+|  mem-estimate=16.00MB mem-reservation=16.00MB spill-buffer=8.00MB 
thread-reservation=0
 |  tuple-ids=3,2 row-size=6B cardinality=7300
 |
 01:SORT
 |  order by: int_col ASC NULLS FIRST
-|  mem-estimate=24.00MB mem-reservation=24.00MB spill-buffer=8.00MB
+|  mem-estimate=24.00MB mem-reservation=24.00MB spill-buffer=8.00MB 
thread-reservation=0
 |  tuple-ids=3 row-size=5B cardinality=7300
 |
 03:EXCHANGE [HASH(int_col)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0 row-size=5B cardinality=7300
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
-Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB
+Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB 
thread-reservation=2
 00:SCAN HDFS [functional.alltypes, RANDOM]
    partitions=24/24 files=24 size=478.45KB
    stored statistics:
@@ -362,6 +362,6 @@ Per-Host Resources: mem-estimate=16.00MB 
mem-reservation=32.00KB
      partitions: 24/24 rows=7300
      columns: all
    extrapolated-rows=disabled max-scan-range-rows=310
-   mem-estimate=16.00MB mem-reservation=32.00KB
+   mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
    tuple-ids=0 row-size=5B cardinality=7300
 ====

http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/min-max-runtime-filters.test
----------------------------------------------------------------------
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 b5a0e42..d638a61 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
@@ -3,29 +3,29 @@ select count(*) from functional_kudu.alltypes a, 
functional_kudu.alltypestiny b
 where a.int_col = b.tinyint_col + 1 and a.string_col = b.string_col
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB
+|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
-|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=2 row-size=8B cardinality=1
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: a.string_col = b.string_col, a.int_col = b.tinyint_col + 1
 |  fk/pk conjuncts: none
 |  runtime filters: RF002[min_max] <- b.string_col, RF003[min_max] <- 
b.tinyint_col + 1
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=39B cardinality=5840
 |
 |--01:SCAN KUDU [functional_kudu.alltypestiny b]
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=1
 |     tuple-ids=1 row-size=18B cardinality=8
 |
 00:SCAN KUDU [functional_kudu.alltypes a]
    runtime filters: RF002[min_max] -> a.string_col, RF003[min_max] -> a.int_col
-   mem-estimate=0B mem-reservation=0B
+   mem-estimate=0B mem-reservation=0B thread-reservation=1
    tuple-ids=0 row-size=21B cardinality=7300
 ====
 # Filters are not created if the target isn't a bare Kudu column or if 'is 
(not) distinct'
@@ -36,28 +36,28 @@ where a.int_col + 1 = b.int_col
     and a.tinyint_col is not distinct from b.tinyint_col
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB
+|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
-|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=2 row-size=8B cardinality=1
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: a.tinyint_col IS NOT DISTINCT FROM b.tinyint_col, 
a.int_col + 1 = b.int_col
 |  fk/pk conjuncts: assumed fk/pk
 |  other predicates: a.string_col IS DISTINCT FROM b.string_col
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=44B cardinality=7300
 |
 |--01:SCAN KUDU [functional_kudu.alltypestiny b]
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=1
 |     tuple-ids=1 row-size=22B cardinality=8
 |
 00:SCAN KUDU [functional_kudu.alltypes a]
-   mem-estimate=0B mem-reservation=0B
+   mem-estimate=0B mem-reservation=0B thread-reservation=1
    tuple-ids=0 row-size=22B cardinality=7300
 ====
 # Filters are only assigned when the target expr is cast if its an implicit 
integer cast.
@@ -68,29 +68,29 @@ where a.tinyint_col = b.bigint_col
     and cast(a.float_col as double) = b.double_col
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB
+|  Per-Host Resources: mem-estimate=11.94MB mem-reservation=1.94MB 
thread-reservation=3
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 03:AGGREGATE [FINALIZE]
 |  output: count(*)
-|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=2 row-size=8B cardinality=1
 |
 02:HASH JOIN [INNER JOIN]
 |  hash predicates: CAST(a.float_col AS DOUBLE) = b.double_col, CAST(a.int_col 
AS SMALLINT) = b.smallint_col, a.string_col = b.timestamp_col, a.tinyint_col = 
b.bigint_col
 |  fk/pk conjuncts: a.string_col = b.timestamp_col, a.tinyint_col = 
b.bigint_col
 |  runtime filters: RF007[min_max] <- b.bigint_col
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=60B cardinality=1460
 |
 |--01:SCAN KUDU [functional_kudu.alltypestiny b]
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=1
 |     tuple-ids=1 row-size=34B cardinality=8
 |
 00:SCAN KUDU [functional_kudu.alltypes a]
    runtime filters: RF007[min_max] -> a.tinyint_col
-   mem-estimate=0B mem-reservation=0B
+   mem-estimate=0B mem-reservation=0B thread-reservation=1
    tuple-ids=0 row-size=26B cardinality=7300
 ====
 # Query with both Kudu and HDFS filter targets.
@@ -99,31 +99,31 @@ select count(*) from functional_kudu.alltypes a, 
functional_parquet.alltypes b,
 where a.int_col = b.int_col and a.int_col = c.int_col
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=2.02GB mem-reservation=36.95MB 
runtime-filters-memory=1.00MB
+|  Per-Host Resources: mem-estimate=2.02GB mem-reservation=36.95MB 
thread-reservation=4 runtime-filters-memory=1.00MB
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:AGGREGATE [FINALIZE]
 |  output: count(*)
-|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=3 row-size=8B cardinality=1
 |
 04:HASH JOIN [INNER JOIN]
 |  hash predicates: a.int_col = c.int_col
 |  fk/pk conjuncts: none
 |  runtime filters: RF000[bloom] <- c.int_col, RF001[min_max] <- c.int_col
-|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  tuple-ids=0,1,2 row-size=12B cardinality=5329000
 |
 |--02:SCAN KUDU [functional_kudu.alltypes c]
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=1
 |     tuple-ids=2 row-size=4B cardinality=7300
 |
 03:HASH JOIN [INNER JOIN]
 |  hash predicates: a.int_col = b.int_col
 |  fk/pk conjuncts: assumed fk/pk
 |  runtime filters: RF003[min_max] <- b.int_col
-|  mem-estimate=2.00GB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=2.00GB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=0,1 row-size=8B cardinality=7300
 |
 |--01:SCAN HDFS [functional_parquet.alltypes b]
@@ -134,11 +134,11 @@ PLAN-ROOT SINK
 |       partitions: 0/24 rows=unavailable
 |       columns: unavailable
 |     extrapolated-rows=disabled max-scan-range-rows=unavailable
-|     mem-estimate=16.00MB mem-reservation=16.00KB
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
 |     tuple-ids=1 row-size=4B cardinality=unavailable
 |
 00:SCAN KUDU [functional_kudu.alltypes a]
    runtime filters: RF001[min_max] -> a.int_col, RF003[min_max] -> a.int_col
-   mem-estimate=0B mem-reservation=0B
+   mem-estimate=0B mem-reservation=0B thread-reservation=1
    tuple-ids=0 row-size=4B cardinality=7300
 ====

http://git-wip-us.apache.org/repos/asf/impala/blob/e12ee485/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
----------------------------------------------------------------------
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 f5ee389..53fb5c4 100644
--- 
a/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
+++ 
b/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
@@ -40,19 +40,19 @@ order by cnt, bigint_col
 limit 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=144.00MB mem-reservation=34.02MB
+|  Per-Host Resources: mem-estimate=144.00MB mem-reservation=34.02MB 
thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:TOP-N [LIMIT=10]
 |  order by: count(int_col) ASC, bigint_col ASC
-|  mem-estimate=160B mem-reservation=0B
+|  mem-estimate=160B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2 row-size=16B cardinality=10
 |
 01:AGGREGATE [FINALIZE]
 |  output: count(int_col)
 |  group by: bigint_col
-|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=16B cardinality=unavailable
 |
 00:SCAN HDFS [functional_parquet.alltypes]
@@ -65,43 +65,43 @@ PLAN-ROOT SINK
    extrapolated-rows=disabled max-scan-range-rows=unavailable
    parquet statistics predicates: id < 10
    parquet dictionary predicates: id < 10
-   mem-estimate=16.00MB mem-reservation=24.00KB
+   mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
    tuple-ids=0 row-size=16B cardinality=unavailable
 ---- PARALLELPLANS
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 05:MERGING-EXCHANGE [UNPARTITIONED]
 |  order by: count(int_col) ASC, bigint_col ASC
 |  limit: 10
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2 row-size=16B cardinality=10
 |
 F01:PLAN FRAGMENT [HASH(bigint_col)] hosts=3 instances=9
-Per-Host Resources: mem-estimate=384.00MB mem-reservation=102.00MB
+Per-Host Resources: mem-estimate=384.00MB mem-reservation=102.00MB 
thread-reservation=3
 02:TOP-N [LIMIT=10]
 |  order by: count(int_col) ASC, bigint_col ASC
-|  mem-estimate=160B mem-reservation=0B
+|  mem-estimate=160B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2 row-size=16B cardinality=10
 |
 04:AGGREGATE [FINALIZE]
 |  output: count:merge(int_col)
 |  group by: bigint_col
-|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=16B cardinality=unavailable
 |
 03:EXCHANGE [HASH(bigint_col)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1 row-size=16B cardinality=unavailable
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
-Per-Host Resources: mem-estimate=432.00MB mem-reservation=102.07MB
+Per-Host Resources: mem-estimate=432.00MB mem-reservation=102.07MB 
thread-reservation=3
 01:AGGREGATE [STREAMING]
 |  output: count(int_col)
 |  group by: bigint_col
-|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB
+|  mem-estimate=128.00MB mem-reservation=34.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=1 row-size=16B cardinality=unavailable
 |
 00:SCAN HDFS [functional_parquet.alltypes, RANDOM]
@@ -114,7 +114,7 @@ Per-Host Resources: mem-estimate=432.00MB 
mem-reservation=102.07MB
    extrapolated-rows=disabled max-scan-range-rows=unavailable
    parquet statistics predicates: id < 10
    parquet dictionary predicates: id < 10
-   mem-estimate=16.00MB mem-reservation=24.00KB
+   mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
    tuple-ids=0 row-size=16B cardinality=unavailable
 ====
 # Single-table scan/filter/analytic should work.
@@ -123,21 +123,21 @@ from functional_parquet.alltypes
 where id < 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=10.02MB
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=10.02MB 
thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 02:ANALYTIC
 |  functions: row_number()
 |  partition by: int_col
 |  order by: id ASC
 |  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=4,3 row-size=16B cardinality=unavailable
 |
 01:SORT
 |  order by: int_col ASC NULLS FIRST, id ASC
-|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=4 row-size=8B cardinality=unavailable
 |
 00:SCAN HDFS [functional_parquet.alltypes]
@@ -150,39 +150,39 @@ PLAN-ROOT SINK
    extrapolated-rows=disabled max-scan-range-rows=unavailable
    parquet statistics predicates: id < 10
    parquet dictionary predicates: id < 10
-   mem-estimate=16.00MB mem-reservation=16.00KB
+   mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
    tuple-ids=0 row-size=8B cardinality=unavailable
 ---- PARALLELPLANS
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 04:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=4,3 row-size=16B cardinality=unavailable
 |
 F01:PLAN FRAGMENT [HASH(int_col)] hosts=3 instances=9
-Per-Host Resources: mem-estimate=30.00MB mem-reservation=30.00MB
+Per-Host Resources: mem-estimate=30.00MB mem-reservation=30.00MB 
thread-reservation=3
 02:ANALYTIC
 |  functions: row_number()
 |  partition by: int_col
 |  order by: id ASC
 |  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=4,3 row-size=16B cardinality=unavailable
 |
 01:SORT
 |  order by: int_col ASC NULLS FIRST, id ASC
-|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB 
thread-reservation=0
 |  tuple-ids=4 row-size=8B cardinality=unavailable
 |
 03:EXCHANGE [HASH(int_col)]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=0 row-size=8B cardinality=unavailable
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
-Per-Host Resources: mem-estimate=48.00MB mem-reservation=48.00KB
+Per-Host Resources: mem-estimate=48.00MB mem-reservation=48.00KB 
thread-reservation=3
 00:SCAN HDFS [functional_parquet.alltypes, RANDOM]
    partitions=24/24 files=24 size=188.29KB
    predicates: id < 10
@@ -193,7 +193,7 @@ Per-Host Resources: mem-estimate=48.00MB 
mem-reservation=48.00KB
    extrapolated-rows=disabled max-scan-range-rows=unavailable
    parquet statistics predicates: id < 10
    parquet dictionary predicates: id < 10
-   mem-estimate=16.00MB mem-reservation=16.00KB
+   mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
    tuple-ids=0 row-size=8B cardinality=unavailable
 ====
 # Nested-loop join in a subplan should work.
@@ -202,44 +202,44 @@ from tpch_nested_parquet.customer c, c.c_orders o, 
o.o_lineitems
 where c_custkey < 10 and o_orderkey < 5 and l_linenumber < 3
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=88.00MB mem-reservation=88.00MB
+|  Per-Host Resources: mem-estimate=88.00MB mem-reservation=88.00MB 
thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:SUBPLAN
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2,1,0 row-size=562B cardinality=1500000
 |
 |--08:NESTED LOOP JOIN [CROSS JOIN]
-|  |  mem-estimate=254B mem-reservation=0B
+|  |  mem-estimate=254B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=2,1,0 row-size=562B cardinality=100
 |  |
 |  |--02:SINGULAR ROW SRC
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=0 row-size=254B cardinality=1
 |  |
 |  04:SUBPLAN
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=2,1 row-size=308B cardinality=100
 |  |
 |  |--07:NESTED LOOP JOIN [CROSS JOIN]
-|  |  |  mem-estimate=124B mem-reservation=0B
+|  |  |  mem-estimate=124B mem-reservation=0B thread-reservation=0
 |  |  |  tuple-ids=2,1 row-size=308B cardinality=10
 |  |  |
 |  |  |--05:SINGULAR ROW SRC
 |  |  |     parent-subplan=04
-|  |  |     mem-estimate=0B mem-reservation=0B
+|  |  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  |     tuple-ids=1 row-size=124B cardinality=1
 |  |  |
 |  |  06:UNNEST [o.o_lineitems]
 |  |     parent-subplan=04
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=2 row-size=0B cardinality=10
 |  |
 |  03:UNNEST [c.c_orders o]
 |     parent-subplan=01
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
@@ -257,54 +257,54 @@ PLAN-ROOT SINK
    parquet dictionary predicates: c_custkey < 10
    parquet dictionary predicates on o: o_orderkey < 5
    parquet dictionary predicates on o_lineitems: l_linenumber < 3
-   mem-estimate=88.00MB mem-reservation=88.00MB
+   mem-estimate=88.00MB mem-reservation=88.00MB thread-reservation=0
    tuple-ids=0 row-size=254B cardinality=15000
 ---- PARALLELPLANS
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 09:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2,1,0 row-size=562B cardinality=1500000
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
-Per-Host Resources: mem-estimate=264.00MB mem-reservation=264.00MB
+Per-Host Resources: mem-estimate=264.00MB mem-reservation=264.00MB 
thread-reservation=3
 01:SUBPLAN
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=2,1,0 row-size=562B cardinality=1500000
 |
 |--08:NESTED LOOP JOIN [CROSS JOIN]
-|  |  mem-estimate=254B mem-reservation=0B
+|  |  mem-estimate=254B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=2,1,0 row-size=562B cardinality=100
 |  |
 |  |--02:SINGULAR ROW SRC
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=0 row-size=254B cardinality=1
 |  |
 |  04:SUBPLAN
-|  |  mem-estimate=0B mem-reservation=0B
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=2,1 row-size=308B cardinality=100
 |  |
 |  |--07:NESTED LOOP JOIN [CROSS JOIN]
-|  |  |  mem-estimate=124B mem-reservation=0B
+|  |  |  mem-estimate=124B mem-reservation=0B thread-reservation=0
 |  |  |  tuple-ids=2,1 row-size=308B cardinality=10
 |  |  |
 |  |  |--05:SINGULAR ROW SRC
 |  |  |     parent-subplan=04
-|  |  |     mem-estimate=0B mem-reservation=0B
+|  |  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |  |     tuple-ids=1 row-size=124B cardinality=1
 |  |  |
 |  |  06:UNNEST [o.o_lineitems]
 |  |     parent-subplan=04
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=2 row-size=0B cardinality=10
 |  |
 |  03:UNNEST [c.c_orders o]
 |     parent-subplan=01
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c, RANDOM]
@@ -322,7 +322,7 @@ Per-Host Resources: mem-estimate=264.00MB 
mem-reservation=264.00MB
    parquet dictionary predicates: c_custkey < 10
    parquet dictionary predicates on o: o_orderkey < 5
    parquet dictionary predicates on o_lineitems: l_linenumber < 3
-   mem-estimate=88.00MB mem-reservation=88.00MB
+   mem-estimate=88.00MB mem-reservation=88.00MB thread-reservation=0
    tuple-ids=0 row-size=254B cardinality=15000
 ====
 # Hash-join in a subplan should work.
@@ -331,37 +331,37 @@ from tpch_nested_parquet.customer c, c.c_orders o1, 
c.c_orders o2
 where o1.o_orderkey = o2.o_orderkey + 2 and o1.o_orderkey < 5
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=89.94MB mem-reservation=17.94MB
+|  Per-Host Resources: mem-estimate=89.94MB mem-reservation=17.94MB 
thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 01:SUBPLAN
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1,0,2 row-size=286B cardinality=1500000
 |
 |--06:HASH JOIN [INNER JOIN]
 |  |  hash predicates: o1.o_orderkey = o2.o_orderkey + 2
 |  |  fk/pk conjuncts: assumed fk/pk
-|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  |  tuple-ids=1,0,2 row-size=286B cardinality=10
 |  |
 |  |--04:UNNEST [c.c_orders o2]
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=2 row-size=0B cardinality=10
 |  |
 |  05:NESTED LOOP JOIN [CROSS JOIN]
-|  |  mem-estimate=270B mem-reservation=0B
+|  |  mem-estimate=270B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1,0 row-size=278B cardinality=10
 |  |
 |  |--02:SINGULAR ROW SRC
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=0 row-size=270B cardinality=1
 |  |
 |  03:UNNEST [c.c_orders o1]
 |     parent-subplan=01
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
@@ -374,47 +374,47 @@ PLAN-ROOT SINK
    extrapolated-rows=disabled max-scan-range-rows=44229
    parquet statistics predicates on o1: o1.o_orderkey < 5
    parquet dictionary predicates on o1: o1.o_orderkey < 5
-   mem-estimate=88.00MB mem-reservation=16.00MB
+   mem-estimate=88.00MB mem-reservation=16.00MB thread-reservation=0
    tuple-ids=0 row-size=270B cardinality=150000
 ---- PARALLELPLANS
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B thread-reservation=1
 PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |
 07:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1,0,2 row-size=286B cardinality=1500000
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
-Per-Host Resources: mem-estimate=269.81MB mem-reservation=53.81MB
+Per-Host Resources: mem-estimate=269.81MB mem-reservation=53.81MB 
thread-reservation=3
 01:SUBPLAN
-|  mem-estimate=0B mem-reservation=0B
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  tuple-ids=1,0,2 row-size=286B cardinality=1500000
 |
 |--06:HASH JOIN [INNER JOIN]
 |  |  hash predicates: o1.o_orderkey = o2.o_orderkey + 2
 |  |  fk/pk conjuncts: assumed fk/pk
-|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB 
thread-reservation=0
 |  |  tuple-ids=1,0,2 row-size=286B cardinality=10
 |  |
 |  |--04:UNNEST [c.c_orders o2]
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=2 row-size=0B cardinality=10
 |  |
 |  05:NESTED LOOP JOIN [CROSS JOIN]
-|  |  mem-estimate=270B mem-reservation=0B
+|  |  mem-estimate=270B mem-reservation=0B thread-reservation=0
 |  |  tuple-ids=1,0 row-size=278B cardinality=10
 |  |
 |  |--02:SINGULAR ROW SRC
 |  |     parent-subplan=01
-|  |     mem-estimate=0B mem-reservation=0B
+|  |     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |  |     tuple-ids=0 row-size=270B cardinality=1
 |  |
 |  03:UNNEST [c.c_orders o1]
 |     parent-subplan=01
-|     mem-estimate=0B mem-reservation=0B
+|     mem-estimate=0B mem-reservation=0B thread-reservation=0
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c, RANDOM]
@@ -427,6 +427,6 @@ Per-Host Resources: mem-estimate=269.81MB 
mem-reservation=53.81MB
    extrapolated-rows=disabled max-scan-range-rows=44229
    parquet statistics predicates on o1: o1.o_orderkey < 5
    parquet dictionary predicates on o1: o1.o_orderkey < 5
-   mem-estimate=88.00MB mem-reservation=16.00MB
+   mem-estimate=88.00MB mem-reservation=16.00MB thread-reservation=0
    tuple-ids=0 row-size=270B cardinality=150000
 ====

Reply via email to