You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kg...@apache.org on 2020/04/05 11:48:03 UTC

[hive] branch master updated: HIVE-23082: PK/FK stat rescale doesn't work in some cases (Zoltan Haindrich reviewed by Jesus Camacho Rodriguez)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new bc669b3  HIVE-23082: PK/FK stat rescale doesn't work in some cases (Zoltan Haindrich reviewed by Jesus Camacho Rodriguez)
bc669b3 is described below

commit bc669b31c9897678cca576bd35efe85504b65a3f
Author: Zoltan Haindrich <ki...@rxd.hu>
AuthorDate: Sun Apr 5 11:28:03 2020 +0000

    HIVE-23082: PK/FK stat rescale doesn't work in some cases (Zoltan Haindrich reviewed by Jesus Camacho Rodriguez)
    
    Signed-off-by: Zoltan Haindrich <zh...@cloudera.com>
---
 .../test/resources/testconfiguration.properties    |   1 +
 .../stats/annotation/StatsRulesProcFactory.java    |   3 -
 .../queries/clientpositive/estimate_pkfk_fknulls.q |  35 ++
 .../clientpositive/annotate_stats_join_pkfk.q.out  |  10 +-
 .../convert_decimal64_to_decimal.q.out             |   4 +-
 .../clientpositive/filter_join_breaktask.q.out     |  10 +-
 .../clientpositive/groupby_join_pushdown.q.out     | 154 +++----
 ql/src/test/results/clientpositive/join46.q.out    |  20 +-
 .../llap/convert_decimal64_to_decimal.q.out        |   4 +-
 .../llap/estimate_pkfk_fknulls.q.out               | 196 +++++++++
 .../clientpositive/llap/explainuser_1.q.out        |  18 +-
 .../llap/filter_join_breaktask.q.out               |  12 +-
 .../llap/hybridgrace_hashjoin_1.q.out              |   8 +-
 .../test/results/clientpositive/llap/join46.q.out  |  20 +-
 .../results/clientpositive/llap/mapjoin46.q.out    |  30 +-
 .../results/clientpositive/llap/orc_llap.q.out     |   8 +-
 .../results/clientpositive/llap/semijoin6.q.out    |  10 +-
 .../results/clientpositive/llap/semijoin7.q.out    |  10 +-
 .../clientpositive/llap/semijoin_hint.q.out        |  18 +-
 .../llap/vector_left_outer_join.q.out              |   4 +-
 .../clientpositive/llap/vector_nullsafe_join.q.out |  16 +-
 .../clientpositive/llap/vector_outer_join0.q.out   |   8 +-
 .../clientpositive/llap/vector_outer_join1.q.out   |   8 +-
 .../clientpositive/llap/vector_outer_join2.q.out   |   6 +-
 .../clientpositive/llap/vector_windowing_gby.q.out |   4 +-
 .../llap/vector_windowing_gby2.q.out               |   4 +-
 .../clientpositive/llap/vectorized_join46.q.out    |  10 +-
 .../clientpositive/llap/vectorized_mapjoin.q.out   |   4 +-
 .../llap/vectorized_nested_mapjoin.q.out           |   4 +-
 .../llap/vectorized_shufflejoin.q.out              |   4 +-
 .../clientpositive/llap/windowing_gby.q.out        |   2 +-
 ql/src/test/results/clientpositive/mapjoin46.q.out |  30 +-
 .../results/clientpositive/named_column_join.q.out |   6 +-
 .../clientpositive/perf/tez/cbo_query23.q.out      |   4 +-
 .../perf/tez/constraints/cbo_query23.q.out         |   3 +-
 .../perf/tez/constraints/query1.q.out              |  38 +-
 .../perf/tez/constraints/query10.q.out             | 266 ++++++-------
 .../perf/tez/constraints/query11.q.out             |  46 +--
 .../perf/tez/constraints/query12.q.out             |  14 +-
 .../perf/tez/constraints/query13.q.out             |  14 +-
 .../perf/tez/constraints/query14.q.out             | 198 ++++-----
 .../perf/tez/constraints/query15.q.out             |  16 +-
 .../perf/tez/constraints/query16.q.out             | 109 ++---
 .../perf/tez/constraints/query17.q.out             |  26 +-
 .../perf/tez/constraints/query18.q.out             |  20 +-
 .../perf/tez/constraints/query19.q.out             |  22 +-
 .../perf/tez/constraints/query1b.q.out             |  58 +--
 .../perf/tez/constraints/query20.q.out             |  14 +-
 .../perf/tez/constraints/query23.q.out             | 442 ++++++++++++---------
 .../perf/tez/constraints/query25.q.out             |  22 +-
 .../perf/tez/constraints/query26.q.out             |  10 +-
 .../perf/tez/constraints/query27.q.out             |  20 +-
 .../perf/tez/constraints/query29.q.out             |  22 +-
 .../perf/tez/constraints/query3.q.out              |  12 +-
 .../perf/tez/constraints/query30.q.out             |  44 +-
 .../perf/tez/constraints/query31.q.out             |  66 +--
 .../perf/tez/constraints/query32.q.out             |  20 +-
 .../perf/tez/constraints/query33.q.out             |  56 +--
 .../perf/tez/constraints/query34.q.out             |  14 +-
 .../perf/tez/constraints/query35.q.out             |  38 +-
 .../perf/tez/constraints/query36.q.out             |  10 +-
 .../perf/tez/constraints/query38.q.out             |  46 +--
 .../perf/tez/constraints/query4.q.out              |  60 +--
 .../perf/tez/constraints/query40.q.out             |  12 +-
 .../perf/tez/constraints/query42.q.out             |   6 +-
 .../perf/tez/constraints/query43.q.out             |  10 +-
 .../perf/tez/constraints/query45.q.out             |  20 +-
 .../perf/tez/constraints/query46.q.out             |  24 +-
 .../perf/tez/constraints/query47.q.out             |   8 +-
 .../perf/tez/constraints/query48.q.out             |  10 +-
 .../perf/tez/constraints/query49.q.out             |  94 ++---
 .../perf/tez/constraints/query5.q.out              |  18 +-
 .../perf/tez/constraints/query50.q.out             |  73 ++--
 .../perf/tez/constraints/query51.q.out             |  34 +-
 .../perf/tez/constraints/query52.q.out             |   4 +-
 .../perf/tez/constraints/query53.q.out             |  22 +-
 .../perf/tez/constraints/query54.q.out             |  36 +-
 .../perf/tez/constraints/query55.q.out             |   4 +-
 .../perf/tez/constraints/query56.q.out             |  30 +-
 .../perf/tez/constraints/query57.q.out             |   8 +-
 .../perf/tez/constraints/query58.q.out             |  32 +-
 .../perf/tez/constraints/query59.q.out             |  22 +-
 .../perf/tez/constraints/query60.q.out             |  30 +-
 .../perf/tez/constraints/query61.q.out             |  18 +-
 .../perf/tez/constraints/query63.q.out             |  22 +-
 .../perf/tez/constraints/query64.q.out             |  84 ++--
 .../perf/tez/constraints/query65.q.out             |  34 +-
 .../perf/tez/constraints/query66.q.out             |  22 +-
 .../perf/tez/constraints/query67.q.out             |  26 +-
 .../perf/tez/constraints/query68.q.out             |  24 +-
 .../perf/tez/constraints/query69.q.out             | 196 ++++-----
 .../perf/tez/constraints/query7.q.out              |  10 +-
 .../perf/tez/constraints/query70.q.out             |  12 +-
 .../perf/tez/constraints/query71.q.out             |  24 +-
 .../perf/tez/constraints/query72.q.out             |  34 +-
 .../perf/tez/constraints/query73.q.out             |  14 +-
 .../perf/tez/constraints/query74.q.out             |  46 +--
 .../perf/tez/constraints/query75.q.out             |  86 ++--
 .../perf/tez/constraints/query77.q.out             |  70 ++--
 .../perf/tez/constraints/query78.q.out             |  38 +-
 .../perf/tez/constraints/query79.q.out             |  20 +-
 .../perf/tez/constraints/query8.q.out              |   8 +-
 .../perf/tez/constraints/query80.q.out             |  36 +-
 .../perf/tez/constraints/query81.q.out             |  20 +-
 .../perf/tez/constraints/query83.q.out             |  26 +-
 .../perf/tez/constraints/query84.q.out             |  10 +-
 .../perf/tez/constraints/query85.q.out             |  18 +-
 .../perf/tez/constraints/query86.q.out             |   8 +-
 .../perf/tez/constraints/query87.q.out             |  76 ++--
 .../perf/tez/constraints/query88.q.out             |  48 +--
 .../perf/tez/constraints/query89.q.out             |  22 +-
 .../perf/tez/constraints/query90.q.out             |  10 +-
 .../perf/tez/constraints/query91.q.out             |  12 +-
 .../perf/tez/constraints/query92.q.out             |  20 +-
 .../perf/tez/constraints/query93.q.out             |  59 ++-
 .../perf/tez/constraints/query94.q.out             | 109 ++---
 .../perf/tez/constraints/query95.q.out             | 224 +++++++----
 .../perf/tez/constraints/query96.q.out             |   6 +-
 .../perf/tez/constraints/query97.q.out             |  16 +-
 .../perf/tez/constraints/query98.q.out             |  16 +-
 .../perf/tez/constraints/query99.q.out             |  18 +-
 .../results/clientpositive/perf/tez/query1.q.out   |  38 +-
 .../results/clientpositive/perf/tez/query10.q.out  | 266 ++++++-------
 .../results/clientpositive/perf/tez/query11.q.out  |  44 +-
 .../results/clientpositive/perf/tez/query12.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query13.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query14.q.out  | 204 +++++-----
 .../results/clientpositive/perf/tez/query15.q.out  |  16 +-
 .../results/clientpositive/perf/tez/query16.q.out  | 111 +++---
 .../results/clientpositive/perf/tez/query17.q.out  |  26 +-
 .../results/clientpositive/perf/tez/query18.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query19.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query1b.q.out  | 138 ++++---
 .../results/clientpositive/perf/tez/query20.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query23.q.out  | 381 ++++++++++--------
 .../results/clientpositive/perf/tez/query25.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query26.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query27.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query29.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query3.q.out   |  12 +-
 .../results/clientpositive/perf/tez/query30.q.out  |  44 +-
 .../results/clientpositive/perf/tez/query31.q.out  |  66 +--
 .../results/clientpositive/perf/tez/query32.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query33.q.out  |  56 +--
 .../results/clientpositive/perf/tez/query34.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query35.q.out  |  38 +-
 .../results/clientpositive/perf/tez/query36.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query38.q.out  |  46 +--
 .../results/clientpositive/perf/tez/query4.q.out   |  58 +--
 .../results/clientpositive/perf/tez/query40.q.out  |  12 +-
 .../results/clientpositive/perf/tez/query42.q.out  |   6 +-
 .../results/clientpositive/perf/tez/query43.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query45.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query46.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query47.q.out  |   8 +-
 .../results/clientpositive/perf/tez/query48.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query49.q.out  |  88 ++--
 .../results/clientpositive/perf/tez/query5.q.out   |  18 +-
 .../results/clientpositive/perf/tez/query50.q.out  |  89 +++--
 .../results/clientpositive/perf/tez/query51.q.out  |  34 +-
 .../results/clientpositive/perf/tez/query52.q.out  |   4 +-
 .../results/clientpositive/perf/tez/query53.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query54.q.out  |  34 +-
 .../results/clientpositive/perf/tez/query55.q.out  |   4 +-
 .../results/clientpositive/perf/tez/query56.q.out  |  30 +-
 .../results/clientpositive/perf/tez/query57.q.out  |   8 +-
 .../results/clientpositive/perf/tez/query58.q.out  |  30 +-
 .../results/clientpositive/perf/tez/query59.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query6.q.out   |  18 +-
 .../results/clientpositive/perf/tez/query60.q.out  |  30 +-
 .../results/clientpositive/perf/tez/query61.q.out  |  18 +-
 .../results/clientpositive/perf/tez/query63.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query64.q.out  |  76 ++--
 .../results/clientpositive/perf/tez/query65.q.out  |  38 +-
 .../results/clientpositive/perf/tez/query66.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query67.q.out  |  26 +-
 .../results/clientpositive/perf/tez/query68.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query69.q.out  | 196 ++++-----
 .../results/clientpositive/perf/tez/query7.q.out   |  10 +-
 .../results/clientpositive/perf/tez/query70.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query71.q.out  |  24 +-
 .../results/clientpositive/perf/tez/query72.q.out  |  36 +-
 .../results/clientpositive/perf/tez/query73.q.out  |  14 +-
 .../results/clientpositive/perf/tez/query74.q.out  |  44 +-
 .../results/clientpositive/perf/tez/query75.q.out  |  86 ++--
 .../results/clientpositive/perf/tez/query77.q.out  |  70 ++--
 .../results/clientpositive/perf/tez/query78.q.out  |  40 +-
 .../results/clientpositive/perf/tez/query79.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query8.q.out   |   8 +-
 .../results/clientpositive/perf/tez/query80.q.out  |  36 +-
 .../results/clientpositive/perf/tez/query81.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query83.q.out  |  26 +-
 .../results/clientpositive/perf/tez/query84.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query85.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query86.q.out  |   8 +-
 .../results/clientpositive/perf/tez/query87.q.out  |  76 ++--
 .../results/clientpositive/perf/tez/query88.q.out  |  48 +--
 .../results/clientpositive/perf/tez/query89.q.out  |  22 +-
 .../results/clientpositive/perf/tez/query90.q.out  |  10 +-
 .../results/clientpositive/perf/tez/query91.q.out  |  16 +-
 .../results/clientpositive/perf/tez/query92.q.out  |  20 +-
 .../results/clientpositive/perf/tez/query93.q.out  |  61 +--
 .../results/clientpositive/perf/tez/query94.q.out  | 111 +++---
 .../results/clientpositive/perf/tez/query95.q.out  | 236 ++++++-----
 .../results/clientpositive/perf/tez/query96.q.out  |   6 +-
 .../results/clientpositive/perf/tez/query97.q.out  |  16 +-
 .../results/clientpositive/perf/tez/query98.q.out  |  16 +-
 .../results/clientpositive/perf/tez/query99.q.out  |  18 +-
 .../clientpositive/spark/spark_explainuser_1.q.out |  22 +-
 .../tez/hybridgrace_hashjoin_1.q.out               |   8 +-
 .../clientpositive/vector_left_outer_join.q.out    |   4 +-
 .../clientpositive/vector_outer_join0.q.out        |   8 +-
 .../clientpositive/vector_outer_join1.q.out        |   8 +-
 .../clientpositive/vector_outer_join2.q.out        |   4 +-
 .../clientpositive/vector_outer_join3.q.out        |   6 +-
 .../clientpositive/vector_outer_join4.q.out        |   4 +-
 .../clientpositive/vectorized_join46_mr.q.out      |  10 +-
 .../clientpositive/vectorized_mapjoin.q.out        |   4 +-
 .../clientpositive/vectorized_shufflejoin.q.out    |   4 +-
 .../results/clientpositive/windowing_gby2.q.out    |   2 +-
 220 files changed, 4484 insertions(+), 3889 deletions(-)

diff --git a/itests/src/test/resources/testconfiguration.properties b/itests/src/test/resources/testconfiguration.properties
index 42d652d..af8e961 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -557,6 +557,7 @@ minillaplocal.query.files=\
   enforce_constraint_notnull.q,\
   escape1.q,\
   escape2.q,\
+  estimate_pkfk_fknulls.q,\
   estimate_pkfk_nocond.q,\
   estimate_pkfk_filtered_fk.q,\
   estimate_pkfk_push.q,\
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
index 43fc449..4318c4b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java
@@ -883,9 +883,6 @@ public class StatsRulesProcFactory {
         if (cs != null) {
           tmpNoNulls = cs.getNumNulls();
         }
-        if (cs == null || tmpNoNulls > 0) {
-          aspCtx.addAffectedColumn(encd);
-        }
       } else if (pred instanceof ExprNodeGenericFuncDesc || pred instanceof ExprNodeColumnListDesc) {
         long noNullsOfChild = 0;
         for (ExprNodeDesc childExpr : pred.getChildren()) {
diff --git a/ql/src/test/queries/clientpositive/estimate_pkfk_fknulls.q b/ql/src/test/queries/clientpositive/estimate_pkfk_fknulls.q
new file mode 100644
index 0000000..bb547fc
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/estimate_pkfk_fknulls.q
@@ -0,0 +1,35 @@
+set hive.query.results.cache.enabled=false;
+set hive.explain.user=true;
+set hive.semantic.analyzer.hook=org.apache.hadoop.hive.ql.hooks.AccurateEstimatesCheckerHook;
+
+drop table if exists default.rx0;
+drop table if exists default.sr0;
+
+create table rx0 (r_reason_id string, r_reason_sk bigint);
+create table sr0 (sr_reason_sk bigint);
+
+insert into rx0 values ('AAAAAAAAAAAAAAAA',1),('AAAAAAAAGEAAAAAA',70),
+('A_2',2),('A_3',3),('A_4',4),('A_5',5),('A_6',6),('A_7',7),('A_8',8),('A_9',9),('A_10',10),('A_11',11),('A_12',12),('A_13',13),('A_14',14),('A_15',15),('A_16',16),('A_17',17),('A_18',18),('A_19',19),('A_20',20),('A_21',21),('A_22',22),('A_23',23),('A_24',24),('A_25',25),('A_26',26),('A_27',27),('A_28',28),('A_29',29),('A_30',30),('A_31',31),('A_32',32),('A_33',33),('A_34',34),('A_35',35),('A_36',36),('A_37',37),('A_38',38),('A_39',39),('A_40',40),('A_41',41),('A_42',42),('A_43',43),('A_ [...]
+
+insert into sr0 values (NULL),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),
+(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),
+(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),
+(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70);
+
+desc formatted sr0 sr_reason_sk;
+
+insert into sr0 select a.* from sr0 a,sr0 b;
+-- at this point: the sr0 will have 5112 rows
+
+desc formatted sr0 sr_reason_sk;
+
+analyze table sr0 compute statistics for columns;
+
+desc formatted sr0 sr_reason_sk;
+
+explain analyze select 1
+from default.sr0  store_returns , default.rx0 reason
+            where sr_reason_sk = r_reason_sk
+              and r_reason_id = 'AAAAAAAAAAAAAAAA';
+
diff --git a/ql/src/test/results/clientpositive/annotate_stats_join_pkfk.q.out b/ql/src/test/results/clientpositive/annotate_stats_join_pkfk.q.out
index 1f95ffa..21a1b12 100644
--- a/ql/src/test/results/clientpositive/annotate_stats_join_pkfk.q.out
+++ b/ql/src/test/results/clientpositive/annotate_stats_join_pkfk.q.out
@@ -643,10 +643,10 @@ STAGE PLANS:
             0 _col0 (type: int)
             1 _col0 (type: int)
           outputColumnNames: _col0
-          Statistics: Num rows: 876 Data size: 3504 Basic stats: COMPLETE Column stats: PARTIAL
+          Statistics: Num rows: 90 Data size: 360 Basic stats: COMPLETE Column stats: PARTIAL
           File Output Operator
             compressed: false
-            Statistics: Num rows: 876 Data size: 3504 Basic stats: COMPLETE Column stats: PARTIAL
+            Statistics: Num rows: 90 Data size: 360 Basic stats: COMPLETE Column stats: PARTIAL
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1412,14 +1412,14 @@ STAGE PLANS:
             0 _col0 (type: int)
             1 _col0 (type: int)
           outputColumnNames: _col2
-          Statistics: Num rows: 241 Data size: 964 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 223 Data size: 892 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col2 (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 241 Data size: 964 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 223 Data size: 892 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 241 Data size: 964 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 223 Data size: 892 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/convert_decimal64_to_decimal.q.out b/ql/src/test/results/clientpositive/convert_decimal64_to_decimal.q.out
index f6cfb92..b463bd4 100644
--- a/ql/src/test/results/clientpositive/convert_decimal64_to_decimal.q.out
+++ b/ql/src/test/results/clientpositive/convert_decimal64_to_decimal.q.out
@@ -212,7 +212,7 @@ STAGE PLANS:
                       nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true
                       nativeConditionsNotMet: hive.execution.engine mr IN [tez, spark] IS false
                   outputColumnNames: _col1
-                  Statistics: Num rows: 958 Data size: 3480 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 894 Data size: 3224 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: count(_col1)
                     Group By Vectorization:
@@ -372,7 +372,7 @@ STAGE PLANS:
                       nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true
                       nativeConditionsNotMet: hive.execution.engine mr IN [tez, spark] IS false
                   outputColumnNames: _col1
-                  Statistics: Num rows: 958 Data size: 3480 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 894 Data size: 3224 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: count(_col1)
                     Group By Vectorization:
diff --git a/ql/src/test/results/clientpositive/filter_join_breaktask.q.out b/ql/src/test/results/clientpositive/filter_join_breaktask.q.out
index 565d628..dd9fa63 100644
--- a/ql/src/test/results/clientpositive/filter_join_breaktask.q.out
+++ b/ql/src/test/results/clientpositive/filter_join_breaktask.q.out
@@ -158,7 +158,7 @@ STAGE PLANS:
             0 _col0 (type: int)
             1 _col0 (type: int)
           outputColumnNames: _col0, _col2
-          Statistics: Num rows: 25 Data size: 2305 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 15 Data size: 1375 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             GlobalTableId: 0
@@ -188,7 +188,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col2 (type: string)
-              Statistics: Num rows: 25 Data size: 2305 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 15 Data size: 1375 Basic stats: COMPLETE Column stats: COMPLETE
               tag: 0
               value expressions: _col0 (type: int)
               auto parallelism: false
@@ -298,17 +298,17 @@ STAGE PLANS:
             0 _col2 (type: string)
             1 _col0 (type: string)
           outputColumnNames: _col0, _col3
-          Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col0 (type: int), _col3 (type: string)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
               GlobalTableId: 0
 #### A masked pattern was here ####
               NumFilesPerFileSink: 1
-              Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
 #### A masked pattern was here ####
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
diff --git a/ql/src/test/results/clientpositive/groupby_join_pushdown.q.out b/ql/src/test/results/clientpositive/groupby_join_pushdown.q.out
index eed2f65..2138eae 100644
--- a/ql/src/test/results/clientpositive/groupby_join_pushdown.q.out
+++ b/ql/src/test/results/clientpositive/groupby_join_pushdown.q.out
@@ -651,14 +651,14 @@ STAGE PLANS:
             0 _col1 (type: int)
             1 _col1 (type: int)
           outputColumnNames: _col0, _col2, _col3
-          Statistics: Num rows: 18464 Data size: 258240 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 13785 Data size: 183376 Basic stats: COMPLETE Column stats: COMPLETE
           Group By Operator
             aggregations: sum(_col2)
             keys: _col0 (type: tinyint), _col3 (type: tinyint)
             minReductionHashAggr: 0.99
             mode: hash
             outputColumnNames: _col0, _col1, _col2
-            Statistics: Num rows: 9232 Data size: 138416 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 6892 Data size: 100984 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
               table:
@@ -675,7 +675,7 @@ STAGE PLANS:
               null sort order: zz
               sort order: ++
               Map-reduce partition columns: _col0 (type: tinyint), _col1 (type: tinyint)
-              Statistics: Num rows: 9232 Data size: 138416 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 6892 Data size: 100984 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col2 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -684,10 +684,10 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint), KEY._col1 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 9232 Data size: 138416 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 6892 Data size: 100984 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 9232 Data size: 138416 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 6892 Data size: 100984 Basic stats: COMPLETE Column stats: COMPLETE
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -740,13 +740,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 4419 Data size: 44076 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 4586 Data size: 45744 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: bigint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: bigint)
-                    Statistics: Num rows: 4419 Data size: 44076 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 4586 Data size: 45744 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: int)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -755,7 +755,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: bigint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 4419 Data size: 44076 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 4586 Data size: 45744 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -772,7 +772,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: bigint)
-              Statistics: Num rows: 4419 Data size: 44076 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 4586 Data size: 45744 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: int)
           TableScan
             Reduce Output Operator
@@ -780,7 +780,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: bigint)
-              Statistics: Num rows: 4419 Data size: 26400 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 4586 Data size: 27400 Basic stats: COMPLETE Column stats: COMPLETE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -789,14 +789,14 @@ STAGE PLANS:
             0 _col0 (type: bigint)
             1 _col0 (type: bigint)
           outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 4420 Data size: 70496 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 4586 Data size: 73144 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col0 (type: bigint), _col2 (type: bigint), _col1 (type: int)
             outputColumnNames: _col0, _col1, _col2
-            Statistics: Num rows: 4420 Data size: 70496 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 4586 Data size: 73144 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 4420 Data size: 70496 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 4586 Data size: 73144 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -821,20 +821,20 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0
-                  Statistics: Num rows: 4419 Data size: 26400 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 4586 Data size: 27400 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: bigint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: bigint)
-                    Statistics: Num rows: 4419 Data size: 26400 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 4586 Data size: 27400 Basic stats: COMPLETE Column stats: COMPLETE
       Execution mode: vectorized
       Reduce Operator Tree:
         Group By Operator
           keys: KEY._col0 (type: bigint)
           mode: mergepartial
           outputColumnNames: _col0
-          Statistics: Num rows: 4419 Data size: 26400 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 4586 Data size: 27400 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -889,13 +889,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: tinyint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -904,7 +904,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -921,7 +921,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: tinyint)
           TableScan
             Reduce Output Operator
@@ -929,7 +929,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -938,14 +938,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 100 Data size: 1008 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 132 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col0 (type: tinyint), _col2 (type: tinyint), _col1 (type: tinyint)
             outputColumnNames: _col0, _col1, _col2
-            Statistics: Num rows: 100 Data size: 1008 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 132 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 100 Data size: 1008 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 132 Data size: 1328 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -970,20 +970,20 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0
-                  Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
       Execution mode: vectorized
       Reduce Operator Tree:
         Group By Operator
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0
-          Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1038,13 +1038,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: int)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1053,7 +1053,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1070,7 +1070,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 696 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 920 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: int)
           TableScan
             Reduce Output Operator
@@ -1078,7 +1078,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -1087,14 +1087,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col1
-          Statistics: Num rows: 100 Data size: 400 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 132 Data size: 528 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col1 (type: int)
             outputColumnNames: _col0
-            Statistics: Num rows: 100 Data size: 400 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 132 Data size: 528 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 100 Data size: 400 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 132 Data size: 528 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1119,20 +1119,20 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0
-                  Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
       Execution mode: vectorized
       Reduce Operator Tree:
         Group By Operator
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0
-          Statistics: Num rows: 99 Data size: 300 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 396 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1187,13 +1187,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1202,7 +1202,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1219,7 +1219,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
           TableScan
             Reduce Output Operator
@@ -1227,7 +1227,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
       Reduce Operator Tree:
         Join Operator
@@ -1237,14 +1237,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col1, _col3
-          Statistics: Num rows: 100 Data size: 1600 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 132 Data size: 2112 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: (_col1 * _col3) (type: bigint)
             outputColumnNames: _col0
-            Statistics: Num rows: 100 Data size: 800 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 132 Data size: 1056 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 100 Data size: 800 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 132 Data size: 1056 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1270,13 +1270,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1285,7 +1285,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1340,13 +1340,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1355,7 +1355,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1372,7 +1372,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
           TableScan
             Reduce Output Operator
@@ -1380,7 +1380,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
       Reduce Operator Tree:
         Join Operator
@@ -1390,14 +1390,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col0, _col1, _col3
-          Statistics: Num rows: 100 Data size: 1904 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 132 Data size: 2512 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: (_col1 * _col3) (type: bigint), _col0 (type: tinyint)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 100 Data size: 1104 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 132 Data size: 1456 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 100 Data size: 1104 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 132 Data size: 1456 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1423,13 +1423,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1438,7 +1438,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1493,13 +1493,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1508,7 +1508,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1525,7 +1525,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
           TableScan
             Reduce Output Operator
@@ -1533,7 +1533,7 @@ STAGE PLANS:
               null sort order: z
               sort order: +
               Map-reduce partition columns: _col0 (type: tinyint)
-              Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col1 (type: bigint)
       Reduce Operator Tree:
         Join Operator
@@ -1543,14 +1543,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col0, _col1, _col3
-          Statistics: Num rows: 100 Data size: 1904 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 132 Data size: 2512 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: (_col1 * _col3) (type: bigint), _col0 (type: tinyint)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 100 Data size: 1104 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 132 Data size: 1456 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 100 Data size: 1104 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 132 Data size: 1456 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1576,13 +1576,13 @@ STAGE PLANS:
                   minReductionHashAggr: 0.99
                   mode: hash
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     key expressions: _col0 (type: tinyint)
                     null sort order: z
                     sort order: +
                     Map-reduce partition columns: _col0 (type: tinyint)
-                    Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col1 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1591,7 +1591,7 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1
-          Statistics: Num rows: 99 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 131 Data size: 1444 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
             table:
@@ -1793,14 +1793,14 @@ STAGE PLANS:
             0 _col0 (type: tinyint)
             1 _col0 (type: tinyint)
           outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 858611 Data size: 10275444 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 647260 Data size: 7739232 Basic stats: COMPLETE Column stats: COMPLETE
           Group By Operator
             aggregations: sum(_col1)
             keys: _col0 (type: tinyint), _col2 (type: tinyint)
             minReductionHashAggr: 0.99
             mode: hash
             outputColumnNames: _col0, _col1, _col2
-            Statistics: Num rows: 9801 Data size: 156608 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 17161 Data size: 274088 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
               table:
@@ -1817,7 +1817,7 @@ STAGE PLANS:
               null sort order: zz
               sort order: ++
               Map-reduce partition columns: _col0 (type: tinyint), _col1 (type: tinyint)
-              Statistics: Num rows: 9801 Data size: 156608 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 17161 Data size: 274088 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col2 (type: bigint)
       Execution mode: vectorized
       Reduce Operator Tree:
@@ -1826,14 +1826,14 @@ STAGE PLANS:
           keys: KEY._col0 (type: tinyint), KEY._col1 (type: tinyint)
           mode: mergepartial
           outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 9801 Data size: 156608 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 17161 Data size: 274088 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col2 (type: bigint), _col0 (type: tinyint)
             outputColumnNames: _col0, _col1
-            Statistics: Num rows: 9801 Data size: 117508 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 17161 Data size: 205688 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 9801 Data size: 117508 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 17161 Data size: 205688 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/join46.q.out b/ql/src/test/results/clientpositive/join46.q.out
index 10c332d..c05fd32 100644
--- a/ql/src/test/results/clientpositive/join46.q.out
+++ b/ql/src/test/results/clientpositive/join46.q.out
@@ -427,10 +427,10 @@ STAGE PLANS:
             0 _col1 (type: int)
             1 _col1 (type: int)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-          Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1497,14 +1497,14 @@ STAGE PLANS:
             1 _col1 (type: int)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
           residual filter predicates: {(_col0 BETWEEN 100 AND 102 or _col6)}
-          Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 7 Data size: 1265 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
             outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-            Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2060,11 +2060,11 @@ STAGE PLANS:
             1 _col1 (type: int)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
           residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-          Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
             outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-            Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
               table:
@@ -2079,7 +2079,7 @@ STAGE PLANS:
             Reduce Output Operator
               null sort order: 
               sort order: 
-              Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
               value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
           TableScan
             Reduce Output Operator
@@ -2096,10 +2096,10 @@ STAGE PLANS:
             1 
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
           residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-          Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/convert_decimal64_to_decimal.q.out b/ql/src/test/results/clientpositive/llap/convert_decimal64_to_decimal.q.out
index da76c54..145ef94 100644
--- a/ql/src/test/results/clientpositive/llap/convert_decimal64_to_decimal.q.out
+++ b/ql/src/test/results/clientpositive/llap/convert_decimal64_to_decimal.q.out
@@ -200,7 +200,7 @@ STAGE PLANS:
                         outputColumnNames: _col1
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 958 Data size: 3480 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 894 Data size: 3224 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count(_col1)
                           Group By Vectorization:
@@ -421,7 +421,7 @@ STAGE PLANS:
                         outputColumnNames: _col1
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 958 Data size: 3480 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 894 Data size: 3224 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count(_col1)
                           Group By Vectorization:
diff --git a/ql/src/test/results/clientpositive/llap/estimate_pkfk_fknulls.q.out b/ql/src/test/results/clientpositive/llap/estimate_pkfk_fknulls.q.out
new file mode 100644
index 0000000..8aef47b
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/estimate_pkfk_fknulls.q.out
@@ -0,0 +1,196 @@
+PREHOOK: query: drop table if exists default.rx0
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists default.rx0
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists default.sr0
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists default.sr0
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table rx0 (r_reason_id string, r_reason_sk bigint)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@rx0
+POSTHOOK: query: create table rx0 (r_reason_id string, r_reason_sk bigint)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@rx0
+PREHOOK: query: create table sr0 (sr_reason_sk bigint)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@sr0
+POSTHOOK: query: create table sr0 (sr_reason_sk bigint)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@sr0
+PREHOOK: query: insert into rx0 values ('AAAAAAAAAAAAAAAA',1),('AAAAAAAAGEAAAAAA',70),
+('A_2',2),('A_3',3),('A_4',4),('A_5',5),('A_6',6),('A_7',7),('A_8',8),('A_9',9),('A_10',10),('A_11',11),('A_12',12),('A_13',13),('A_14',14),('A_15',15),('A_16',16),('A_17',17),('A_18',18),('A_19',19),('A_20',20),('A_21',21),('A_22',22),('A_23',23),('A_24',24),('A_25',25),('A_26',26),('A_27',27),('A_28',28),('A_29',29),('A_30',30),('A_31',31),('A_32',32),('A_33',33),('A_34',34),('A_35',35),('A_36',36),('A_37',37),('A_38',38),('A_39',39),('A_40',40),('A_41',41),('A_42',42),('A_43',43),('A_ [...]
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@rx0
+POSTHOOK: query: insert into rx0 values ('AAAAAAAAAAAAAAAA',1),('AAAAAAAAGEAAAAAA',70),
+('A_2',2),('A_3',3),('A_4',4),('A_5',5),('A_6',6),('A_7',7),('A_8',8),('A_9',9),('A_10',10),('A_11',11),('A_12',12),('A_13',13),('A_14',14),('A_15',15),('A_16',16),('A_17',17),('A_18',18),('A_19',19),('A_20',20),('A_21',21),('A_22',22),('A_23',23),('A_24',24),('A_25',25),('A_26',26),('A_27',27),('A_28',28),('A_29',29),('A_30',30),('A_31',31),('A_32',32),('A_33',33),('A_34',34),('A_35',35),('A_36',36),('A_37',37),('A_38',38),('A_39',39),('A_40',40),('A_41',41),('A_42',42),('A_43',43),('A_ [...]
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@rx0
+POSTHOOK: Lineage: rx0.r_reason_id SCRIPT []
+POSTHOOK: Lineage: rx0.r_reason_sk SCRIPT []
+PREHOOK: query: insert into sr0 values (NULL),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),
+(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),
+(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),
+(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@sr0
+POSTHOOK: query: insert into sr0 values (NULL),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),
+(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),
+(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),
+(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@sr0
+POSTHOOK: Lineage: sr0.sr_reason_sk SCRIPT []
+PREHOOK: query: desc formatted sr0 sr_reason_sk
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@sr0
+POSTHOOK: query: desc formatted sr0 sr_reason_sk
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@sr0
+col_name            	sr_reason_sk        
+data_type           	bigint              
+min                 	1                   
+max                 	70                  
+num_nulls           	1                   
+distinct_count      	70                  
+avg_col_len         	                    
+max_col_len         	                    
+num_trues           	                    
+num_falses          	                    
+bit_vector          	HL                  
+comment             	from deserializer   
+COLUMN_STATS_ACCURATE	{\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"sr_reason_sk\":\"true\"}}
+Warning: Shuffle Join MERGEJOIN[16][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+PREHOOK: query: insert into sr0 select a.* from sr0 a,sr0 b
+PREHOOK: type: QUERY
+PREHOOK: Input: default@sr0
+PREHOOK: Output: default@sr0
+POSTHOOK: query: insert into sr0 select a.* from sr0 a,sr0 b
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@sr0
+POSTHOOK: Output: default@sr0
+POSTHOOK: Lineage: sr0.sr_reason_sk SIMPLE [(sr0)a.FieldSchema(name:sr_reason_sk, type:bigint, comment:null), ]
+PREHOOK: query: desc formatted sr0 sr_reason_sk
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@sr0
+POSTHOOK: query: desc formatted sr0 sr_reason_sk
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@sr0
+col_name            	sr_reason_sk        
+data_type           	bigint              
+min                 	1                   
+max                 	70                  
+num_nulls           	72                  
+distinct_count      	73                  
+avg_col_len         	                    
+max_col_len         	                    
+num_trues           	                    
+num_falses          	                    
+bit_vector          	HL                  
+comment             	from deserializer   
+COLUMN_STATS_ACCURATE	{\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"sr_reason_sk\":\"true\"}}
+PREHOOK: query: analyze table sr0 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@sr0
+PREHOOK: Output: default@sr0
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table sr0 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@sr0
+POSTHOOK: Output: default@sr0
+#### A masked pattern was here ####
+PREHOOK: query: desc formatted sr0 sr_reason_sk
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@sr0
+POSTHOOK: query: desc formatted sr0 sr_reason_sk
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@sr0
+col_name            	sr_reason_sk        
+data_type           	bigint              
+min                 	1                   
+max                 	70                  
+num_nulls           	72                  
+distinct_count      	73                  
+avg_col_len         	                    
+max_col_len         	                    
+num_trues           	                    
+num_falses          	                    
+bit_vector          	HL                  
+comment             	from deserializer   
+COLUMN_STATS_ACCURATE	{\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"sr_reason_sk\":\"true\"}}
+PREHOOK: query: select 1
+from default.sr0  store_returns , default.rx0 reason
+            where sr_reason_sk = r_reason_sk
+              and r_reason_id = 'AAAAAAAAAAAAAAAA'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@rx0
+PREHOOK: Input: default@sr0
+#### A masked pattern was here ####
+POSTHOOK: query: select 1
+from default.sr0  store_returns , default.rx0 reason
+            where sr_reason_sk = r_reason_sk
+              and r_reason_id = 'AAAAAAAAAAAAAAAA'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@rx0
+POSTHOOK: Input: default@sr0
+#### A masked pattern was here ####
+PREHOOK: query: explain analyze select 1
+from default.sr0  store_returns , default.rx0 reason
+            where sr_reason_sk = r_reason_sk
+              and r_reason_id = 'AAAAAAAAAAAAAAAA'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@rx0
+PREHOOK: Input: default@sr0
+#### A masked pattern was here ####
+POSTHOOK: query: explain analyze select 1
+from default.sr0  store_returns , default.rx0 reason
+            where sr_reason_sk = r_reason_sk
+              and r_reason_id = 'AAAAAAAAAAAAAAAA'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@rx0
+POSTHOOK: Input: default@sr0
+#### A masked pattern was here ####
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
+
+Stage-0
+  Fetch Operator
+    limit:-1
+    Stage-1
+      Reducer 2 llap
+      File Output Operator [FS_10]
+        Select Operator [SEL_9] (rows=73/72 width=4)
+          Output:["_col0"]
+          Merge Join Operator [MERGEJOIN_25] (rows=73/72 width=8)
+            Conds:RS_28._col0=RS_31._col0(Inner)
+          <-Map 1 [SIMPLE_EDGE] vectorized, llap
+            SHUFFLE [RS_28]
+              PartitionCols:_col0
+              Select Operator [SEL_27] (rows=5040/5040 width=7)
+                Output:["_col0"]
+                Filter Operator [FIL_26] (rows=5040/5040 width=7)
+                  predicate:sr_reason_sk is not null
+                  TableScan [TS_0] (rows=5112/5112 width=7)
+                    default@sr0,store_returns,Tbl:COMPLETE,Col:COMPLETE,Output:["sr_reason_sk"]
+          <-Map 3 [SIMPLE_EDGE] vectorized, llap
+            SHUFFLE [RS_31]
+              PartitionCols:_col0
+              Select Operator [SEL_30] (rows=1/1 width=8)
+                Output:["_col0"]
+                Filter Operator [FIL_29] (rows=1/1 width=96)
+                  predicate:((r_reason_id = 'AAAAAAAAAAAAAAAA') and r_reason_sk is not null)
+                  TableScan [TS_3] (rows=70/70 width=96)
+                    default@rx0,reason,Tbl:COMPLETE,Col:COMPLETE,Output:["r_reason_id","r_reason_sk"]
+
diff --git a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
index 49d77ec..7f0ce5a 100644
--- a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
@@ -467,7 +467,7 @@ Stage-0
                       <-Reducer 2 [SIMPLE_EDGE] llap
                         SHUFFLE [RS_20]
                           PartitionCols:_col3
-                          Merge Join Operator [MERGEJOIN_63] (rows=2 width=105)
+                          Merge Join Operator [MERGEJOIN_63] (rows=5 width=104)
                             Conds:RS_17._col0=RS_18._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"],residual filter predicates:{((_col4 > 0) or _col2)}
                           <-Map 1 [SIMPLE_EDGE] llap
                             SHUFFLE [RS_17]
@@ -481,9 +481,9 @@ Stage-0
                           <-Reducer 7 [SIMPLE_EDGE] llap
                             SHUFFLE [RS_18]
                               PartitionCols:_col0
-                              Select Operator [SEL_9] (rows=1 width=97)
+                              Select Operator [SEL_9] (rows=2 width=97)
                                 Output:["_col0","_col1","_col2"]
-                                Group By Operator [GBY_8] (rows=1 width=101)
+                                Group By Operator [GBY_8] (rows=2 width=101)
                                   Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                 <-Map 6 [SIMPLE_EDGE] llap
                                   SHUFFLE [RS_7]
@@ -1351,9 +1351,9 @@ Stage-0
     Stage-1
       Reducer 3 llap
       File Output Operator [FS_16]
-        Select Operator [SEL_15] (rows=39 width=100)
+        Select Operator [SEL_15] (rows=24 width=100)
           Output:["_col0","_col1","_col2","_col3","_col4"]
-          Merge Join Operator [MERGEJOIN_49] (rows=39 width=104)
+          Merge Join Operator [MERGEJOIN_49] (rows=24 width=104)
             Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7"],residual filter predicates:{((_col1 > 0) or _col7)} {((_col1 > 0) or (_col6 >= 0))}
           <-Map 5 [SIMPLE_EDGE] llap
             SHUFFLE [RS_13]
@@ -1367,7 +1367,7 @@ Stage-0
           <-Reducer 2 [SIMPLE_EDGE] llap
             SHUFFLE [RS_12]
               PartitionCols:_col0
-              Merge Join Operator [MERGEJOIN_48] (rows=13 width=182)
+              Merge Join Operator [MERGEJOIN_48] (rows=8 width=182)
                 Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4"],residual filter predicates:{((_col1 + _col4) = 2)}
               <-Map 1 [SIMPLE_EDGE] llap
                 SHUFFLE [RS_9]
@@ -1416,9 +1416,9 @@ Stage-0
     Stage-1
       Reducer 3 llap
       File Output Operator [FS_16]
-        Select Operator [SEL_15] (rows=39 width=100)
+        Select Operator [SEL_15] (rows=24 width=100)
           Output:["_col0","_col1","_col2","_col3","_col4"]
-          Merge Join Operator [MERGEJOIN_49] (rows=39 width=104)
+          Merge Join Operator [MERGEJOIN_49] (rows=24 width=104)
             Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7"],residual filter predicates:{((_col1 > 0) or _col7)} {((_col1 > 0) or (_col6 >= 0))}
           <-Map 5 [SIMPLE_EDGE] llap
             SHUFFLE [RS_13]
@@ -1432,7 +1432,7 @@ Stage-0
           <-Reducer 2 [SIMPLE_EDGE] llap
             SHUFFLE [RS_12]
               PartitionCols:_col0
-              Merge Join Operator [MERGEJOIN_48] (rows=13 width=182)
+              Merge Join Operator [MERGEJOIN_48] (rows=8 width=182)
                 Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4"],residual filter predicates:{((_col1 + _col4) = 2)}
               <-Map 1 [SIMPLE_EDGE] llap
                 SHUFFLE [RS_9]
diff --git a/ql/src/test/results/clientpositive/llap/filter_join_breaktask.q.out b/ql/src/test/results/clientpositive/llap/filter_join_breaktask.q.out
index fc7b671..40ac1f2 100644
--- a/ql/src/test/results/clientpositive/llap/filter_join_breaktask.q.out
+++ b/ql/src/test/results/clientpositive/llap/filter_join_breaktask.q.out
@@ -304,13 +304,13 @@ STAGE PLANS:
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col2
                 Position of Big Table: 1
-                Statistics: Num rows: 25 Data size: 2305 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 15 Data size: 1375 Basic stats: COMPLETE Column stats: COMPLETE
                 Reduce Output Operator
                   key expressions: _col2 (type: string)
                   null sort order: z
                   sort order: +
                   Map-reduce partition columns: _col2 (type: string)
-                  Statistics: Num rows: 25 Data size: 2305 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 15 Data size: 1375 Basic stats: COMPLETE Column stats: COMPLETE
                   tag: 0
                   value expressions: _col0 (type: int)
                   auto parallelism: true
@@ -325,18 +325,18 @@ STAGE PLANS:
                   0 _col2 (type: string)
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col3
-                Position of Big Table: 0
-                Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+                Position of Big Table: 1
+                Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col3 (type: string)
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
                     GlobalTableId: 0
 #### A masked pattern was here ####
                     NumFilesPerFileSink: 1
-                    Statistics: Num rows: 32 Data size: 2956 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 19 Data size: 1747 Basic stats: COMPLETE Column stats: COMPLETE
 #### A masked pattern was here ####
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
diff --git a/ql/src/test/results/clientpositive/llap/hybridgrace_hashjoin_1.q.out b/ql/src/test/results/clientpositive/llap/hybridgrace_hashjoin_1.q.out
index 064ff3c..009881f 100644
--- a/ql/src/test/results/clientpositive/llap/hybridgrace_hashjoin_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/hybridgrace_hashjoin_1.q.out
@@ -319,7 +319,7 @@ STAGE PLANS:
                           1 _col0 (type: int)
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 18464 Data size: 147712 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 13785 Data size: 110280 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count()
                           minReductionHashAggr: 0.99
@@ -445,7 +445,7 @@ STAGE PLANS:
                           1 _col0 (type: int)
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 18464 Data size: 147712 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 13785 Data size: 110280 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count()
                           minReductionHashAggr: 0.99
@@ -567,7 +567,7 @@ STAGE PLANS:
                         1 _col0 (type: int)
                       input vertices:
                         1 Map 3
-                      Statistics: Num rows: 21560 Data size: 172480 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 18466 Data size: 147728 Basic stats: COMPLETE Column stats: COMPLETE
                       Group By Operator
                         aggregations: count()
                         minReductionHashAggr: 0.99
@@ -689,7 +689,7 @@ STAGE PLANS:
                         1 _col0 (type: int)
                       input vertices:
                         1 Map 3
-                      Statistics: Num rows: 21560 Data size: 172480 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 18466 Data size: 147728 Basic stats: COMPLETE Column stats: COMPLETE
                       Group By Operator
                         aggregations: count()
                         minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/join46.q.out b/ql/src/test/results/clientpositive/llap/join46.q.out
index 2dddb8b..16b86b5 100644
--- a/ql/src/test/results/clientpositive/llap/join46.q.out
+++ b/ql/src/test/results/clientpositive/llap/join46.q.out
@@ -483,10 +483,10 @@ STAGE PLANS:
                   0 _col1 (type: int)
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1693,14 +1693,14 @@ STAGE PLANS:
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 residual filter predicates: {(_col0 BETWEEN 100 AND 102 or _col6)}
-                Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1265 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
-                    Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2350,15 +2350,15 @@ STAGE PLANS:
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-                Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     null sort order: 
                     sort order: 
-                    Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
         Reducer 3 
             Execution mode: llap
@@ -2371,10 +2371,10 @@ STAGE PLANS:
                   1 
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
                 residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-                Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/mapjoin46.q.out b/ql/src/test/results/clientpositive/llap/mapjoin46.q.out
index 305ae5a..8c0cf94 100644
--- a/ql/src/test/results/clientpositive/llap/mapjoin46.q.out
+++ b/ql/src/test/results/clientpositive/llap/mapjoin46.q.out
@@ -451,10 +451,10 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                       input vertices:
                         0 Map 1
-                      Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                       File Output Operator
                         compressed: false
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                         table:
                             input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1485,14 +1485,14 @@ STAGE PLANS:
                       input vertices:
                         0 Map 1
                       residual filter predicates: {(_col0 BETWEEN 100 AND 102 or _col6)}
-                      Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1265 Basic stats: COMPLETE Column stats: COMPLETE
                       Select Operator
                         expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
                         outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                         File Output Operator
                           compressed: false
-                          Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                           table:
                               input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2567,15 +2567,15 @@ STAGE PLANS:
                       input vertices:
                         1 Map 3
                       residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-                      Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
                       Select Operator
                         expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
                         outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                         Reduce Output Operator
                           null sort order: 
                           sort order: 
-                          Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                           value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
             Execution mode: llap
             LLAP IO: no inputs
@@ -2657,10 +2657,10 @@ STAGE PLANS:
                   1 
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
                 residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-                Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2817,15 +2817,15 @@ STAGE PLANS:
                       input vertices:
                         1 Map 3
                       residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-                      Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
                       Select Operator
                         expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
                         outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                         Reduce Output Operator
                           null sort order: 
                           sort order: 
-                          Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                           value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
             Execution mode: llap
             LLAP IO: no inputs
@@ -2907,10 +2907,10 @@ STAGE PLANS:
                   1 
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
                 residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-                Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/orc_llap.q.out b/ql/src/test/results/clientpositive/llap/orc_llap.q.out
index 5f224ef..a0c8de7 100644
--- a/ql/src/test/results/clientpositive/llap/orc_llap.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_llap.q.out
@@ -649,11 +649,11 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col3
                         input vertices:
                           0 Map 1
-                        Statistics: Num rows: 285509 Data size: 50948874 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 159130 Data size: 26936864 Basic stats: COMPLETE Column stats: COMPLETE
                         Select Operator
                           expressions: hash(_col1,_col3) (type: int)
                           outputColumnNames: _col0
-                          Statistics: Num rows: 285509 Data size: 50948874 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 159130 Data size: 26936864 Basic stats: COMPLETE Column stats: COMPLETE
                           Group By Operator
                             aggregations: sum(_col0)
                             minReductionHashAggr: 0.99
@@ -1140,11 +1140,11 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col3
                         input vertices:
                           0 Map 1
-                        Statistics: Num rows: 1142036 Data size: 210391074 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 636522 Data size: 114343414 Basic stats: COMPLETE Column stats: COMPLETE
                         Select Operator
                           expressions: hash(_col1,_col3) (type: int)
                           outputColumnNames: _col0
-                          Statistics: Num rows: 1142036 Data size: 210391074 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 636522 Data size: 114343414 Basic stats: COMPLETE Column stats: COMPLETE
                           Group By Operator
                             aggregations: sum(_col0)
                             minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/semijoin6.q.out b/ql/src/test/results/clientpositive/llap/semijoin6.q.out
index 91edec7..0966ed2 100644
--- a/ql/src/test/results/clientpositive/llap/semijoin6.q.out
+++ b/ql/src/test/results/clientpositive/llap/semijoin6.q.out
@@ -117,10 +117,10 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -440,14 +440,14 @@ STAGE PLANS:
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col3
                 residual filter predicates: {(_col1 <> _col3)}
-                Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3 Data size: 36 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: int)
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
-                    Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/semijoin7.q.out b/ql/src/test/results/clientpositive/llap/semijoin7.q.out
index 7fff806..f50c970 100644
--- a/ql/src/test/results/clientpositive/llap/semijoin7.q.out
+++ b/ql/src/test/results/clientpositive/llap/semijoin7.q.out
@@ -113,10 +113,10 @@ STAGE PLANS:
                   0 a (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 4 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3 Data size: 24 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -428,14 +428,14 @@ STAGE PLANS:
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col6
                 residual filter predicates: {(_col1 <> _col6)}
-                Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3 Data size: 36 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: int)
                   outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3 Data size: 36 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
-                    Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 3 Data size: 36 Basic stats: COMPLETE Column stats: COMPLETE
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/semijoin_hint.q.out b/ql/src/test/results/clientpositive/llap/semijoin_hint.q.out
index 7303505..10e3ba0 100644
--- a/ql/src/test/results/clientpositive/llap/semijoin_hint.q.out
+++ b/ql/src/test/results/clientpositive/llap/semijoin_hint.q.out
@@ -536,17 +536,17 @@ STAGE PLANS:
                   0 cstring (type: string)
                   1 value (type: string)
                 outputColumnNames: str
-                Statistics: Num rows: 4110 Data size: 357570 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3068 Data size: 266916 Basic stats: COMPLETE Column stats: COMPLETE
                 Reduce Output Operator
                   key expressions: str (type: string)
                   null sort order: z
                   sort order: +
                   Map-reduce partition columns: str (type: string)
-                  Statistics: Num rows: 4110 Data size: 357570 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3068 Data size: 266916 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: str (type: string)
                   outputColumnNames: _col0
-                  Statistics: Num rows: 4110 Data size: 715140 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3068 Data size: 533832 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: min(_col0), max(_col0), bloom_filter(_col0, expectedEntries=5000)
                     minReductionHashAggr: 0.99
@@ -567,9 +567,9 @@ STAGE PLANS:
                 keys:
                   0 str (type: string)
                   1 key1 (type: string)
-                Statistics: Num rows: 4521 Data size: 393327 Basic stats: PARTIAL Column stats: NONE
+                Statistics: Num rows: 3374 Data size: 293607 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  Statistics: Num rows: 4521 Data size: 393327 Basic stats: PARTIAL Column stats: NONE
+                  Statistics: Num rows: 3374 Data size: 293607 Basic stats: PARTIAL Column stats: NONE
                   Group By Operator
                     aggregations: count()
                     minReductionHashAggr: 0.99
@@ -1689,17 +1689,17 @@ STAGE PLANS:
                   0 _col0 (type: string)
                   1 _col1 (type: string)
                 outputColumnNames: _col1
-                Statistics: Num rows: 4110 Data size: 357570 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 3068 Data size: 266916 Basic stats: COMPLETE Column stats: COMPLETE
                 Reduce Output Operator
                   key expressions: _col1 (type: string)
                   null sort order: z
                   sort order: +
                   Map-reduce partition columns: _col1 (type: string)
-                  Statistics: Num rows: 4110 Data size: 357570 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3068 Data size: 266916 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col1 (type: string)
                   outputColumnNames: _col0
-                  Statistics: Num rows: 4110 Data size: 715140 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 3068 Data size: 533832 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: min(_col0), max(_col0), bloom_filter(_col0, expectedEntries=5000)
                     minReductionHashAggr: 0.99
@@ -1720,7 +1720,7 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: string)
                   1 _col0 (type: string)
-                Statistics: Num rows: 4521 Data size: 393327 Basic stats: PARTIAL Column stats: NONE
+                Statistics: Num rows: 3374 Data size: 293607 Basic stats: PARTIAL Column stats: NONE
                 Group By Operator
                   aggregations: count()
                   minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/vector_left_outer_join.q.out b/ql/src/test/results/clientpositive/llap/vector_left_outer_join.q.out
index 606aa62..bc1eba8 100644
--- a/ql/src/test/results/clientpositive/llap/vector_left_outer_join.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_left_outer_join.q.out
@@ -55,7 +55,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       input vertices:
                         1 Map 3
-                      Statistics: Num rows: 21560 Data size: 73784 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 18466 Data size: 61408 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Left Outer Join 0 to 1
@@ -64,7 +64,7 @@ STAGE PLANS:
                           1 _col0 (type: tinyint)
                         input vertices:
                           1 Map 4
-                        Statistics: Num rows: 1528346 Data size: 12226768 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 1302989 Data size: 10423912 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count()
                           minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/vector_nullsafe_join.q.out b/ql/src/test/results/clientpositive/llap/vector_nullsafe_join.q.out
index c161fd0..23ddb4a 100644
--- a/ql/src/test/results/clientpositive/llap/vector_nullsafe_join.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_nullsafe_join.q.out
@@ -215,7 +215,7 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col5, _col6
                       input vertices:
                         1 Map 2
-                      Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 3 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
@@ -232,7 +232,7 @@ STAGE PLANS:
                         outputColumnNames: _col0, _col1, _col5, _col6, _col10, _col11
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                         Select Operator
                           expressions: _col0 (type: int), _col1 (type: int), _col5 (type: int), _col6 (type: int), _col10 (type: int), _col11 (type: int)
                           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
@@ -240,13 +240,13 @@ STAGE PLANS:
                               className: VectorSelectOperator
                               native: true
                               projectedOutputColumnNums: [0, 1, 2, 3, 4, 5]
-                          Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                           File Output Operator
                             compressed: false
                             File Sink Vectorization:
                                 className: VectorFileSinkOperator
                                 native: false
-                            Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                             table:
                                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1323,7 +1323,7 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col5, _col6
                       input vertices:
                         1 Map 2
-                      Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 3 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
@@ -1338,7 +1338,7 @@ STAGE PLANS:
                         outputColumnNames: _col0, _col1, _col5, _col6, _col10, _col11
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                         Select Operator
                           expressions: _col0 (type: int), _col1 (type: int), _col5 (type: int), _col6 (type: int), _col10 (type: int), _col11 (type: int)
                           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
@@ -1346,13 +1346,13 @@ STAGE PLANS:
                               className: VectorSelectOperator
                               native: true
                               projectedOutputColumnNums: [0, 1, 2, 3, 0, 4]
-                          Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                           File Output Operator
                             compressed: false
                             File Sink Vectorization:
                                 className: VectorFileSinkOperator
                                 native: false
-                            Statistics: Num rows: 6 Data size: 120 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                             table:
                                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/vector_outer_join0.q.out b/ql/src/test/results/clientpositive/llap/vector_outer_join0.q.out
index ec88afe..1511b4a 100644
--- a/ql/src/test/results/clientpositive/llap/vector_outer_join0.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_outer_join0.q.out
@@ -126,13 +126,13 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col2, _col3
                       input vertices:
                         1 Map 2
-                      Statistics: Num rows: 8 Data size: 1484 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 9 Data size: 1480 Basic stats: COMPLETE Column stats: COMPLETE
                       File Output Operator
                         compressed: false
                         File Sink Vectorization:
                             className: VectorFileSinkOperator
                             native: false
-                        Statistics: Num rows: 8 Data size: 1484 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 9 Data size: 1480 Basic stats: COMPLETE Column stats: COMPLETE
                         table:
                             input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -349,13 +349,13 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col2, _col3
                       input vertices:
                         0 Map 1
-                      Statistics: Num rows: 12 Data size: 1763 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 9 Data size: 1484 Basic stats: COMPLETE Column stats: COMPLETE
                       File Output Operator
                         compressed: false
                         File Sink Vectorization:
                             className: VectorFileSinkOperator
                             native: false
-                        Statistics: Num rows: 12 Data size: 1763 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 9 Data size: 1484 Basic stats: COMPLETE Column stats: COMPLETE
                         table:
                             input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/vector_outer_join1.q.out b/ql/src/test/results/clientpositive/llap/vector_outer_join1.q.out
index af3dbbf..003950f 100644
--- a/ql/src/test/results/clientpositive/llap/vector_outer_join1.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_outer_join1.q.out
@@ -284,13 +284,13 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23
                       input vertices:
                         1 Map 2
-                      Statistics: Num rows: 33 Data size: 14099 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 18 Data size: 9442 Basic stats: COMPLETE Column stats: COMPLETE
                       File Output Operator
                         compressed: false
                         File Sink Vectorization:
                             className: VectorFileSinkOperator
                             native: false
-                        Statistics: Num rows: 33 Data size: 14099 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 18 Data size: 9442 Basic stats: COMPLETE Column stats: COMPLETE
                         table:
                             input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -751,7 +751,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       input vertices:
                         1 Map 3
-                      Statistics: Num rows: 22 Data size: 72 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 18 Data size: 56 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Left Outer Join 0 to 1
@@ -770,7 +770,7 @@ STAGE PLANS:
                         outputColumnNames: _col0
                         input vertices:
                           1 Map 4
-                        Statistics: Num rows: 220 Data size: 864 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 180 Data size: 704 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count(), sum(_col0)
                           Group By Vectorization:
diff --git a/ql/src/test/results/clientpositive/llap/vector_outer_join2.q.out b/ql/src/test/results/clientpositive/llap/vector_outer_join2.q.out
index b27742a..6254af4 100644
--- a/ql/src/test/results/clientpositive/llap/vector_outer_join2.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_outer_join2.q.out
@@ -299,7 +299,7 @@ STAGE PLANS:
                       outputColumnNames: _col1
                       input vertices:
                         1 Map 3
-                      Statistics: Num rows: 45 Data size: 288 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 25 Data size: 128 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Left Outer Join 0 to 1
@@ -318,7 +318,7 @@ STAGE PLANS:
                         outputColumnNames: _col1
                         input vertices:
                           1 Map 4
-                        Statistics: Num rows: 90 Data size: 648 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 25 Data size: 128 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: count(), sum(_col1)
                           Group By Vectorization:
@@ -328,7 +328,7 @@ STAGE PLANS:
                               native: false
                               vectorProcessingMode: HASH
                               projectedOutputColumnNums: [0, 1]
-                          minReductionHashAggr: 0.98888886
+                          minReductionHashAggr: 0.96
                           mode: hash
                           outputColumnNames: _col0, _col1
                           Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: COMPLETE
diff --git a/ql/src/test/results/clientpositive/llap/vector_windowing_gby.q.out b/ql/src/test/results/clientpositive/llap/vector_windowing_gby.q.out
index 4730252..988e52a 100644
--- a/ql/src/test/results/clientpositive/llap/vector_windowing_gby.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_windowing_gby.q.out
@@ -153,11 +153,11 @@ STAGE PLANS:
                   0 _col0 (type: string)
                   1 _col1 (type: string)
                 outputColumnNames: _col1, _col2, _col3
-                Statistics: Num rows: 36 Data size: 284 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 27 Data size: 212 Basic stats: COMPLETE Column stats: COMPLETE
                 Group By Operator
                   aggregations: sum(_col3), sum(_col1)
                   keys: _col2 (type: boolean)
-                  minReductionHashAggr: 0.9444444
+                  minReductionHashAggr: 0.9259259
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: COMPLETE
diff --git a/ql/src/test/results/clientpositive/llap/vector_windowing_gby2.q.out b/ql/src/test/results/clientpositive/llap/vector_windowing_gby2.q.out
index 6a973ef..20de7bd 100644
--- a/ql/src/test/results/clientpositive/llap/vector_windowing_gby2.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_windowing_gby2.q.out
@@ -1015,11 +1015,11 @@ STAGE PLANS:
                   0 _col0 (type: string)
                   1 _col1 (type: string)
                 outputColumnNames: _col1, _col2, _col3
-                Statistics: Num rows: 36 Data size: 284 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 27 Data size: 212 Basic stats: COMPLETE Column stats: COMPLETE
                 Group By Operator
                   aggregations: sum(_col3), sum(_col1)
                   keys: _col2 (type: boolean)
-                  minReductionHashAggr: 0.9444444
+                  minReductionHashAggr: 0.9259259
                   mode: hash
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: COMPLETE
diff --git a/ql/src/test/results/clientpositive/llap/vectorized_join46.q.out b/ql/src/test/results/clientpositive/llap/vectorized_join46.q.out
index a4c2d09..21035d3 100644
--- a/ql/src/test/results/clientpositive/llap/vectorized_join46.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorized_join46.q.out
@@ -641,13 +641,13 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                       input vertices:
                         0 Map 1
-                      Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                       File Output Operator
                         compressed: false
                         File Sink Vectorization:
                             className: VectorFileSinkOperator
                             native: false
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                         table:
                             input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1977,14 +1977,14 @@ STAGE PLANS:
                       input vertices:
                         0 Map 1
                       residual filter predicates: {(_col0 BETWEEN 100 AND 102 or _col6)}
-                      Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 7 Data size: 1265 Basic stats: COMPLETE Column stats: COMPLETE
                       Select Operator
                         expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
                         outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                        Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                         File Output Operator
                           compressed: false
-                          Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                           table:
                               input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/llap/vectorized_mapjoin.q.out b/ql/src/test/results/clientpositive/llap/vectorized_mapjoin.q.out
index 2758178..22822bf 100644
--- a/ql/src/test/results/clientpositive/llap/vectorized_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorized_mapjoin.q.out
@@ -64,7 +64,7 @@ STAGE PLANS:
                         outputColumnNames: _col0, _col1
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 18464 Data size: 129120 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 13785 Data size: 91688 Basic stats: COMPLETE Column stats: COMPLETE
                         Select Operator
                           expressions: _col0 (type: int), _col1 (type: int), (_col0 + _col1) (type: int)
                           outputColumnNames: _col0, _col1, _col2
@@ -73,7 +73,7 @@ STAGE PLANS:
                               native: true
                               projectedOutputColumnNums: [2, 2, 13]
                               selectExpressions: LongColAddLongColumn(col 2:int, col 2:int) -> 13:int
-                          Statistics: Num rows: 18464 Data size: 129120 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 13785 Data size: 91688 Basic stats: COMPLETE Column stats: COMPLETE
                           Group By Operator
                             aggregations: count(_col0), max(_col1), min(_col0), sum(_col2), count(_col2)
                             Group By Vectorization:
diff --git a/ql/src/test/results/clientpositive/llap/vectorized_nested_mapjoin.q.out b/ql/src/test/results/clientpositive/llap/vectorized_nested_mapjoin.q.out
index 395e3e0..e946e94 100644
--- a/ql/src/test/results/clientpositive/llap/vectorized_nested_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorized_nested_mapjoin.q.out
@@ -45,7 +45,7 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col3
                         input vertices:
                           1 Map 3
-                        Statistics: Num rows: 14848 Data size: 157364 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 11087 Data size: 112232 Basic stats: COMPLETE Column stats: COMPLETE
                         Map Join Operator
                           condition map:
                                Inner Join 0 to 1
@@ -55,7 +55,7 @@ STAGE PLANS:
                           outputColumnNames: _col3
                           input vertices:
                             1 Map 4
-                          Statistics: Num rows: 1389803 Data size: 11104552 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 782315 Data size: 6244648 Basic stats: COMPLETE Column stats: COMPLETE
                           Group By Operator
                             aggregations: sum(_col3)
                             minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/vectorized_shufflejoin.q.out b/ql/src/test/results/clientpositive/llap/vectorized_shufflejoin.q.out
index fad993b..1de22ef 100644
--- a/ql/src/test/results/clientpositive/llap/vectorized_shufflejoin.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorized_shufflejoin.q.out
@@ -125,11 +125,11 @@ STAGE PLANS:
                   0 _col0 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 18464 Data size: 129120 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 13785 Data size: 91688 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: int), (_col0 + _col1) (type: int)
                   outputColumnNames: _col0, _col1, _col2
-                  Statistics: Num rows: 18464 Data size: 129120 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 13785 Data size: 91688 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: count(_col0), max(_col1), min(_col0), sum(_col2), count(_col2)
                     minReductionHashAggr: 0.99
diff --git a/ql/src/test/results/clientpositive/llap/windowing_gby.q.out b/ql/src/test/results/clientpositive/llap/windowing_gby.q.out
index f8a0d18..721066f 100644
--- a/ql/src/test/results/clientpositive/llap/windowing_gby.q.out
+++ b/ql/src/test/results/clientpositive/llap/windowing_gby.q.out
@@ -47,7 +47,7 @@ Stage-0
                       PartitionCols:_col0
                       Group By Operator [GBY_10] (rows=3 width=20)
                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)","sum(_col1)"],keys:_col2
-                        Merge Join Operator [MERGEJOIN_34] (rows=36 width=7)
+                        Merge Join Operator [MERGEJOIN_34] (rows=27 width=7)
                           Conds:RS_37._col0=RS_40._col1(Inner),Output:["_col1","_col2","_col3"]
                         <-Map 1 [SIMPLE_EDGE] vectorized, llap
                           SHUFFLE [RS_37]
diff --git a/ql/src/test/results/clientpositive/mapjoin46.q.out b/ql/src/test/results/clientpositive/mapjoin46.q.out
index fd0e6ba..266bed4 100644
--- a/ql/src/test/results/clientpositive/mapjoin46.q.out
+++ b/ql/src/test/results/clientpositive/mapjoin46.q.out
@@ -439,10 +439,10 @@ STAGE PLANS:
                   0 _col1 (type: int)
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                   table:
                       input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -1445,14 +1445,14 @@ STAGE PLANS:
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 residual filter predicates: {(_col0 BETWEEN 100 AND 102 or _col6)}
-                Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1265 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
-                    Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 7 Data size: 1237 Basic stats: COMPLETE Column stats: COMPLETE
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2449,15 +2449,15 @@ STAGE PLANS:
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-                Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     null sort order: 
                     sort order: 
-                    Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
           TableScan
             alias: test1_n4
@@ -2495,10 +2495,10 @@ STAGE PLANS:
             1 
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
           residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-          Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -2689,15 +2689,15 @@ STAGE PLANS:
                   1 _col1 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
                 residual filter predicates: {(_col4 BETWEEN 100 AND 102 or _col3)}
-                Statistics: Num rows: 8 Data size: 1560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 7 Data size: 1261 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col4 (type: int), _col5 (type: int), _col6 (type: string), _col0 (type: int), _col1 (type: int), _col2 (type: string)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-                  Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                   Reduce Output Operator
                     null sort order: 
                     sort order: 
-                    Statistics: Num rows: 8 Data size: 1528 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 7 Data size: 1233 Basic stats: COMPLETE Column stats: COMPLETE
                     value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string)
           TableScan
             alias: test1_n4
@@ -2735,10 +2735,10 @@ STAGE PLANS:
             1 
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11
           residual filter predicates: {(_col1 is null or (_col10 is null and (_col7 <> _col4)))}
-          Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 72 Data size: 27306 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 63 Data size: 23764 Basic stats: COMPLETE Column stats: COMPLETE
             table:
                 input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                 output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/named_column_join.q.out b/ql/src/test/results/clientpositive/named_column_join.q.out
index 74c05f5..9c0250e 100644
--- a/ql/src/test/results/clientpositive/named_column_join.q.out
+++ b/ql/src/test/results/clientpositive/named_column_join.q.out
@@ -76,14 +76,14 @@ STAGE PLANS:
             0 _col0 (type: int)
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3
-          Statistics: Num rows: 12 Data size: 132 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 9 Data size: 96 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: _col0 (type: int), _col1 (type: int), _col3 (type: int)
             outputColumnNames: _col0, _col1, _col2
-            Statistics: Num rows: 12 Data size: 132 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 9 Data size: 96 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 12 Data size: 132 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 9 Data size: 96 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query23.q.out b/ql/src/test/results/clientpositive/perf/tez/cbo_query23.q.out
index c233338..0ad4660 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query23.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query23.q.out
@@ -1,5 +1,5 @@
-Warning: Shuffle Join MERGEJOIN[454][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 23' is a cross product
-Warning: Shuffle Join MERGEJOIN[456][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 24' is a cross product
+Warning: Shuffle Join MERGEJOIN[454][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 25' is a cross product
+Warning: Shuffle Join MERGEJOIN[456][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 30' is a cross product
 PREHOOK: query: explain cbo
 with frequent_ss_items as 
  (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
index 06252d6..bae58bd 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/cbo_query23.q.out
@@ -1,4 +1,5 @@
-Warning: Shuffle Join MERGEJOIN[358][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 15' is a cross product
+Warning: Shuffle Join MERGEJOIN[358][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 17' is a cross product
+Warning: Shuffle Join MERGEJOIN[360][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 23' is a cross product
 PREHOOK: query: explain cbo
 with frequent_ss_items as 
  (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query1.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query1.q.out
index a5a177d..46da133 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query1.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query1.q.out
@@ -76,15 +76,15 @@ Stage-0
       File Output Operator [FS_165]
         Limit [LIM_164] (rows=100 width=100)
           Number of rows:100
-          Select Operator [SEL_163] (rows=17457727 width=100)
+          Select Operator [SEL_163] (rows=816091 width=100)
             Output:["_col0"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_51]
-              Select Operator [SEL_50] (rows=17457727 width=100)
+              Select Operator [SEL_50] (rows=816091 width=100)
                 Output:["_col0"]
-                Top N Key Operator [TNK_79] (rows=17457727 width=100)
+                Top N Key Operator [TNK_79] (rows=816091 width=100)
                   keys:_col7,top n:100
-                  Merge Join Operator [MERGEJOIN_137] (rows=17457727 width=100)
+                  Merge Join Operator [MERGEJOIN_137] (rows=816091 width=100)
                     Conds:RS_47._col1=RS_162._col0(Inner),Output:["_col7"]
                   <-Map 12 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_162]
@@ -96,29 +96,29 @@ Stage-0
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_47]
                       PartitionCols:_col1
-                      Filter Operator [FIL_46] (rows=17457727 width=227)
+                      Filter Operator [FIL_46] (rows=816091 width=225)
                         predicate:(_col3 > _col4)
-                        Merge Join Operator [MERGEJOIN_136] (rows=52373181 width=227)
+                        Merge Join Operator [MERGEJOIN_136] (rows=2448274 width=225)
                           Conds:RS_43._col2=RS_160._col1(Inner),Output:["_col1","_col3","_col4"]
                         <-Reducer 10 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_160]
                             PartitionCols:_col1
-                            Select Operator [SEL_159] (rows=85 width=115)
+                            Select Operator [SEL_159] (rows=31 width=115)
                               Output:["_col0","_col1"]
-                              Filter Operator [FIL_158] (rows=85 width=123)
+                              Filter Operator [FIL_158] (rows=31 width=123)
                                 predicate:CAST( (_col1 / _col2) AS decimal(21,6)) is not null
-                                Group By Operator [GBY_157] (rows=85 width=123)
+                                Group By Operator [GBY_157] (rows=31 width=123)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)","count(_col2)"],keys:_col1
-                                  Select Operator [SEL_156] (rows=53634860 width=119)
+                                  Select Operator [SEL_156] (rows=14291868 width=119)
                                     Output:["_col1","_col2"]
-                                    Group By Operator [GBY_155] (rows=53634860 width=119)
+                                    Group By Operator [GBY_155] (rows=14291868 width=119)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                     <-Reducer 9 [SIMPLE_EDGE]
                                       SHUFFLE [RS_29]
                                         PartitionCols:_col0
-                                        Group By Operator [GBY_28] (rows=53634860 width=119)
+                                        Group By Operator [GBY_28] (rows=17467258 width=119)
                                           Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                          Merge Join Operator [MERGEJOIN_135] (rows=53634860 width=115)
+                                          Merge Join Operator [MERGEJOIN_135] (rows=17467258 width=107)
                                             Conds:RS_146._col0=RS_150._col0(Inner),Output:["_col1","_col2","_col3"]
                                           <-Map 11 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_150]
@@ -141,7 +141,7 @@ Stage-0
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_43]
                             PartitionCols:_col2
-                            Merge Join Operator [MERGEJOIN_134] (rows=51757026 width=119)
+                            Merge Join Operator [MERGEJOIN_134] (rows=2369298 width=114)
                               Conds:RS_140._col0=RS_154._col1(Inner),Output:["_col1","_col2","_col3"]
                             <-Map 1 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_140]
@@ -155,18 +155,18 @@ Stage-0
                             <-Reducer 8 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_154]
                                 PartitionCols:_col1
-                                Select Operator [SEL_153] (rows=51757026 width=119)
+                                Select Operator [SEL_153] (rows=14291868 width=119)
                                   Output:["_col0","_col1","_col2"]
-                                  Filter Operator [FIL_152] (rows=51757026 width=119)
+                                  Filter Operator [FIL_152] (rows=14291868 width=119)
                                     predicate:_col2 is not null
-                                    Group By Operator [GBY_151] (rows=51757026 width=119)
+                                    Group By Operator [GBY_151] (rows=14291868 width=119)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                     <-Reducer 7 [SIMPLE_EDGE]
                                       SHUFFLE [RS_14]
                                         PartitionCols:_col0, _col1
-                                        Group By Operator [GBY_13] (rows=51757026 width=119)
+                                        Group By Operator [GBY_13] (rows=16855704 width=119)
                                           Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                          Merge Join Operator [MERGEJOIN_133] (rows=51757026 width=115)
+                                          Merge Join Operator [MERGEJOIN_133] (rows=16855704 width=107)
                                             Conds:RS_145._col0=RS_149._col0(Inner),Output:["_col1","_col2","_col3"]
                                           <-Map 11 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_149]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query10.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query10.q.out
index d245a60..8bb4e95 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query10.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query10.q.out
@@ -133,174 +133,98 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 11 <- Reducer 14 (BROADCAST_EDGE)
-Map 21 <- Reducer 17 (BROADCAST_EDGE)
-Map 22 <- Reducer 20 (BROADCAST_EDGE)
-Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 13 (SIMPLE_EDGE)
-Reducer 14 <- Map 13 (CUSTOM_SIMPLE_EDGE)
-Reducer 15 <- Map 13 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
-Reducer 16 <- Reducer 15 (SIMPLE_EDGE)
-Reducer 17 <- Map 13 (CUSTOM_SIMPLE_EDGE)
-Reducer 18 <- Map 13 (SIMPLE_EDGE), Map 22 (SIMPLE_EDGE)
-Reducer 19 <- Reducer 18 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
-Reducer 20 <- Map 13 (CUSTOM_SIMPLE_EDGE)
-Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 16 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 19 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Map 13 <- Reducer 16 (BROADCAST_EDGE)
+Map 21 <- Reducer 10 (BROADCAST_EDGE)
+Map 22 <- Reducer 9 (BROADCAST_EDGE)
+Reducer 10 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 14 <- Map 13 (SIMPLE_EDGE), Map 15 (SIMPLE_EDGE)
+Reducer 16 <- Map 15 (CUSTOM_SIMPLE_EDGE)
+Reducer 17 <- Map 15 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
+Reducer 18 <- Reducer 17 (SIMPLE_EDGE)
+Reducer 19 <- Map 15 (SIMPLE_EDGE), Map 22 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
+Reducer 20 <- Reducer 19 (SIMPLE_EDGE)
+Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 14 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 18 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 20 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
 Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 5 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
       Reducer 8 vectorized
-      File Output Operator [FS_234]
-        Limit [LIM_233] (rows=1 width=419)
+      File Output Operator [FS_228]
+        Limit [LIM_227] (rows=1 width=419)
           Number of rows:100
-          Select Operator [SEL_232] (rows=1 width=419)
+          Select Operator [SEL_226] (rows=1 width=419)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
           <-Reducer 7 [SIMPLE_EDGE] vectorized
-            SHUFFLE [RS_231]
-              Select Operator [SEL_230] (rows=1 width=419)
+            SHUFFLE [RS_225]
+              Select Operator [SEL_224] (rows=1 width=419)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col6","_col8","_col10","_col12"]
-                Group By Operator [GBY_229] (rows=1 width=379)
+                Group By Operator [GBY_223] (rows=1 width=379)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7
                 <-Reducer 6 [SIMPLE_EDGE]
                   SHUFFLE [RS_66]
                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-                    Group By Operator [GBY_65] (rows=3 width=379)
+                    Group By Operator [GBY_65] (rows=1 width=379)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["count()"],keys:_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13
-                      Select Operator [SEL_64] (rows=1401496 width=379)
+                      Select Operator [SEL_64] (rows=154725 width=379)
                         Output:["_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                        Top N Key Operator [TNK_105] (rows=1401496 width=379)
+                        Top N Key Operator [TNK_105] (rows=154725 width=379)
                           keys:_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13,top n:100
-                          Filter Operator [FIL_63] (rows=1401496 width=379)
+                          Filter Operator [FIL_63] (rows=154725 width=379)
                             predicate:(_col14 is not null or _col16 is not null)
-                            Merge Join Operator [MERGEJOIN_185] (rows=1401496 width=379)
-                              Conds:RS_60._col0=RS_228._col1(Left Outer),Output:["_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col16"]
-                            <-Reducer 19 [SIMPLE_EDGE] vectorized
-                              SHUFFLE [RS_228]
-                                PartitionCols:_col1
-                                Select Operator [SEL_227] (rows=1401496 width=7)
-                                  Output:["_col0","_col1"]
-                                  Group By Operator [GBY_226] (rows=1401496 width=3)
-                                    Output:["_col0"],keys:KEY._col0
-                                  <-Reducer 18 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_43]
-                                      PartitionCols:_col0
-                                      Group By Operator [GBY_42] (rows=285115246 width=3)
-                                        Output:["_col0"],keys:_col1
-                                        Merge Join Operator [MERGEJOIN_182] (rows=285115246 width=3)
-                                          Conds:RS_225._col0=RS_200._col0(Inner),Output:["_col1"]
-                                        <-Map 13 [SIMPLE_EDGE] vectorized
-                                          PARTITION_ONLY_SHUFFLE [RS_200]
-                                            PartitionCols:_col0
-                                            Select Operator [SEL_195] (rows=201 width=4)
-                                              Output:["_col0"]
-                                              Filter Operator [FIL_194] (rows=201 width=12)
-                                                predicate:((d_year = 2002) and d_moy BETWEEN 4 AND 7)
-                                                TableScan [TS_11] (rows=73049 width=12)
-                                                  default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
-                                        <-Map 22 [SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_225]
-                                            PartitionCols:_col0
-                                            Select Operator [SEL_224] (rows=285115246 width=7)
-                                              Output:["_col0","_col1"]
-                                              Filter Operator [FIL_223] (rows=285115246 width=7)
-                                                predicate:(cs_ship_customer_sk is not null and cs_sold_date_sk is not null and cs_sold_date_sk BETWEEN DynamicValue(RS_39_date_dim_d_date_sk_min) AND DynamicValue(RS_39_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_39_date_dim_d_date_sk_bloom_filter)))
-                                                TableScan [TS_32] (rows=287989836 width=7)
-                                                  default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_ship_customer_sk"]
-                                                <-Reducer 20 [BROADCAST_EDGE] vectorized
-                                                  BROADCAST [RS_222]
-                                                    Group By Operator [GBY_221] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                    <-Map 13 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                      PARTITION_ONLY_SHUFFLE [RS_207]
-                                                        Group By Operator [GBY_204] (rows=1 width=12)
-                                                          Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                          Select Operator [SEL_201] (rows=201 width=4)
-                                                            Output:["_col0"]
-                                                             Please refer to the previous Select Operator [SEL_195]
+                            Merge Join Operator [MERGEJOIN_185] (rows=154725 width=379)
+                              Conds:RS_60._col0=RS_222._col1(Left Outer),Output:["_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col16"]
                             <-Reducer 5 [SIMPLE_EDGE]
-                              SHUFFLE [RS_60]
+                              PARTITION_ONLY_SHUFFLE [RS_60]
                                 PartitionCols:_col0
-                                Merge Join Operator [MERGEJOIN_184] (rows=1414922 width=379)
-                                  Conds:RS_57._col0=RS_220._col1(Left Outer),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
-                                <-Reducer 16 [SIMPLE_EDGE] vectorized
-                                  SHUFFLE [RS_220]
-                                    PartitionCols:_col1
-                                    Select Operator [SEL_219] (rows=1414922 width=7)
-                                      Output:["_col0","_col1"]
-                                      Group By Operator [GBY_218] (rows=1414922 width=3)
-                                        Output:["_col0"],keys:KEY._col0
-                                      <-Reducer 15 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_29]
-                                          PartitionCols:_col0
-                                          Group By Operator [GBY_28] (rows=143930993 width=3)
-                                            Output:["_col0"],keys:_col1
-                                            Merge Join Operator [MERGEJOIN_181] (rows=143930993 width=3)
-                                              Conds:RS_217._col0=RS_198._col0(Inner),Output:["_col1"]
-                                            <-Map 13 [SIMPLE_EDGE] vectorized
-                                              PARTITION_ONLY_SHUFFLE [RS_198]
-                                                PartitionCols:_col0
-                                                 Please refer to the previous Select Operator [SEL_195]
-                                            <-Map 21 [SIMPLE_EDGE] vectorized
-                                              SHUFFLE [RS_217]
-                                                PartitionCols:_col0
-                                                Select Operator [SEL_216] (rows=143930993 width=7)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_215] (rows=143930993 width=7)
-                                                    predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_sold_date_sk BETWEEN DynamicValue(RS_25_date_dim_d_date_sk_min) AND DynamicValue(RS_25_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_25_date_dim_d_date_sk_bloom_filter)))
-                                                    TableScan [TS_18] (rows=144002668 width=7)
-                                                      default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk"]
-                                                    <-Reducer 17 [BROADCAST_EDGE] vectorized
-                                                      BROADCAST [RS_214]
-                                                        Group By Operator [GBY_213] (rows=1 width=12)
-                                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                        <-Map 13 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                          PARTITION_ONLY_SHUFFLE [RS_206]
-                                                            Group By Operator [GBY_203] (rows=1 width=12)
-                                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                              Select Operator [SEL_199] (rows=201 width=4)
-                                                                Output:["_col0"]
-                                                                 Please refer to the previous Select Operator [SEL_195]
+                                Merge Join Operator [MERGEJOIN_184] (rows=155827 width=379)
+                                  Conds:RS_57._col0=RS_214._col1(Left Outer),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
                                 <-Reducer 4 [SIMPLE_EDGE]
                                   SHUFFLE [RS_57]
                                     PartitionCols:_col0
-                                    Merge Join Operator [MERGEJOIN_183] (rows=525327388 width=375)
+                                    Merge Join Operator [MERGEJOIN_183] (rows=22703 width=375)
                                       Conds:RS_54._col0=RS_55._col0(Left Semi),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                                    <-Reducer 12 [SIMPLE_EDGE]
+                                    <-Reducer 14 [SIMPLE_EDGE]
                                       SHUFFLE [RS_55]
                                         PartitionCols:_col0
-                                        Group By Operator [GBY_53] (rows=525327388 width=3)
+                                        Group By Operator [GBY_53] (rows=155827 width=2)
                                           Output:["_col0"],keys:_col0
-                                          Select Operator [SEL_17] (rows=525327388 width=3)
+                                          Select Operator [SEL_17] (rows=57825495 width=2)
                                             Output:["_col0"]
-                                            Merge Join Operator [MERGEJOIN_180] (rows=525327388 width=3)
-                                              Conds:RS_212._col0=RS_196._col0(Inner),Output:["_col1"]
-                                            <-Map 13 [SIMPLE_EDGE] vectorized
-                                              PARTITION_ONLY_SHUFFLE [RS_196]
+                                            Merge Join Operator [MERGEJOIN_180] (rows=57825495 width=2)
+                                              Conds:RS_206._col0=RS_196._col0(Inner),Output:["_col1"]
+                                            <-Map 15 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_196]
                                                 PartitionCols:_col0
-                                                 Please refer to the previous Select Operator [SEL_195]
-                                            <-Map 11 [SIMPLE_EDGE] vectorized
-                                              SHUFFLE [RS_212]
+                                                Select Operator [SEL_195] (rows=201 width=4)
+                                                  Output:["_col0"]
+                                                  Filter Operator [FIL_194] (rows=201 width=12)
+                                                    predicate:((d_year = 2002) and d_moy BETWEEN 4 AND 7)
+                                                    TableScan [TS_11] (rows=73049 width=12)
+                                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                                            <-Map 13 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_206]
                                                 PartitionCols:_col0
-                                                Select Operator [SEL_211] (rows=525327388 width=7)
+                                                Select Operator [SEL_205] (rows=525327388 width=7)
                                                   Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_210] (rows=525327388 width=7)
+                                                  Filter Operator [FIL_204] (rows=525327388 width=7)
                                                     predicate:(ss_sold_date_sk is not null and ss_customer_sk is not null and ss_sold_date_sk BETWEEN DynamicValue(RS_15_date_dim_d_date_sk_min) AND DynamicValue(RS_15_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_15_date_dim_d_date_sk_bloom_filter)))
                                                     TableScan [TS_8] (rows=575995635 width=7)
                                                       default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk"]
-                                                    <-Reducer 14 [BROADCAST_EDGE] vectorized
-                                                      BROADCAST [RS_209]
-                                                        Group By Operator [GBY_208] (rows=1 width=12)
+                                                    <-Reducer 16 [BROADCAST_EDGE] vectorized
+                                                      BROADCAST [RS_203]
+                                                        Group By Operator [GBY_202] (rows=1 width=12)
                                                           Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                        <-Map 13 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                          PARTITION_ONLY_SHUFFLE [RS_205]
-                                                            Group By Operator [GBY_202] (rows=1 width=12)
+                                                        <-Map 15 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                          SHUFFLE [RS_201]
+                                                            Group By Operator [GBY_200] (rows=1 width=12)
                                                               Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
                                                               Select Operator [SEL_197] (rows=201 width=4)
                                                                 Output:["_col0"]
@@ -310,7 +234,7 @@ Stage-0
                                         PartitionCols:_col0
                                         Merge Join Operator [MERGEJOIN_179] (rows=228127 width=375)
                                           Conds:RS_49._col1=RS_193._col0(Inner),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                                        <-Map 10 [SIMPLE_EDGE] vectorized
+                                        <-Map 12 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_193]
                                             PartitionCols:_col0
                                             Select Operator [SEL_192] (rows=1861800 width=375)
@@ -331,7 +255,7 @@ Stage-0
                                                     predicate:(c_current_cdemo_sk is not null and c_current_addr_sk is not null)
                                                     TableScan [TS_0] (rows=80000000 width=11)
                                                       default@customer,c,Tbl:COMPLETE,Col:COMPLETE,Output:["c_customer_sk","c_current_cdemo_sk","c_current_addr_sk"]
-                                            <-Map 9 [SIMPLE_EDGE] vectorized
+                                            <-Map 11 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_191]
                                                 PartitionCols:_col0
                                                 Select Operator [SEL_190] (rows=116550 width=102)
@@ -340,4 +264,80 @@ Stage-0
                                                     predicate:(ca_county) IN ('Walker County', 'Richland County', 'Gaines County', 'Douglas County', 'Dona Ana County')
                                                     TableScan [TS_3] (rows=40000000 width=102)
                                                       default@customer_address,ca,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_county"]
+                                <-Reducer 18 [SIMPLE_EDGE] vectorized
+                                  SHUFFLE [RS_214]
+                                    PartitionCols:_col1
+                                    Select Operator [SEL_213] (rows=155827 width=7)
+                                      Output:["_col0","_col1"]
+                                      Group By Operator [GBY_212] (rows=155827 width=3)
+                                        Output:["_col0"],keys:KEY._col0
+                                      <-Reducer 17 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_29]
+                                          PartitionCols:_col0
+                                          Group By Operator [GBY_28] (rows=155827 width=3)
+                                            Output:["_col0"],keys:_col1
+                                            Merge Join Operator [MERGEJOIN_181] (rows=15843227 width=3)
+                                              Conds:RS_211._col0=RS_198._col0(Inner),Output:["_col1"]
+                                            <-Map 15 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_198]
+                                                PartitionCols:_col0
+                                                 Please refer to the previous Select Operator [SEL_195]
+                                            <-Map 21 [SIMPLE_EDGE] vectorized
+                                              SHUFFLE [RS_211]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_210] (rows=143930993 width=7)
+                                                  Output:["_col0","_col1"]
+                                                  Filter Operator [FIL_209] (rows=143930993 width=7)
+                                                    predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_bill_customer_sk BETWEEN DynamicValue(RS_57_c_c_customer_sk_min) AND DynamicValue(RS_57_c_c_customer_sk_max) and in_bloom_filter(ws_bill_customer_sk, DynamicValue(RS_57_c_c_customer_sk_bloom_filter)))
+                                                    TableScan [TS_18] (rows=144002668 width=7)
+                                                      default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk"]
+                                                    <-Reducer 10 [BROADCAST_EDGE] vectorized
+                                                      BROADCAST [RS_208]
+                                                        Group By Operator [GBY_207] (rows=1 width=12)
+                                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                        <-Reducer 4 [CUSTOM_SIMPLE_EDGE]
+                                                          SHUFFLE [RS_155]
+                                                            Group By Operator [GBY_154] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                              Select Operator [SEL_153] (rows=22703 width=4)
+                                                                Output:["_col0"]
+                                                                 Please refer to the previous Merge Join Operator [MERGEJOIN_183]
+                            <-Reducer 20 [SIMPLE_EDGE] vectorized
+                              SHUFFLE [RS_222]
+                                PartitionCols:_col1
+                                Select Operator [SEL_221] (rows=154725 width=7)
+                                  Output:["_col0","_col1"]
+                                  Group By Operator [GBY_220] (rows=154725 width=3)
+                                    Output:["_col0"],keys:KEY._col0
+                                  <-Reducer 19 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_43]
+                                      PartitionCols:_col0
+                                      Group By Operator [GBY_42] (rows=154725 width=3)
+                                        Output:["_col0"],keys:_col1
+                                        Merge Join Operator [MERGEJOIN_182] (rows=31162251 width=3)
+                                          Conds:RS_219._col0=RS_199._col0(Inner),Output:["_col1"]
+                                        <-Map 15 [SIMPLE_EDGE] vectorized
+                                          SHUFFLE [RS_199]
+                                            PartitionCols:_col0
+                                             Please refer to the previous Select Operator [SEL_195]
+                                        <-Map 22 [SIMPLE_EDGE] vectorized
+                                          SHUFFLE [RS_219]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_218] (rows=285115246 width=7)
+                                              Output:["_col0","_col1"]
+                                              Filter Operator [FIL_217] (rows=285115246 width=7)
+                                                predicate:(cs_ship_customer_sk is not null and cs_sold_date_sk is not null and cs_ship_customer_sk BETWEEN DynamicValue(RS_60_c_c_customer_sk_min) AND DynamicValue(RS_60_c_c_customer_sk_max) and in_bloom_filter(cs_ship_customer_sk, DynamicValue(RS_60_c_c_customer_sk_bloom_filter)))
+                                                TableScan [TS_32] (rows=287989836 width=7)
+                                                  default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_ship_customer_sk"]
+                                                <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                                  BROADCAST [RS_216]
+                                                    Group By Operator [GBY_215] (rows=1 width=12)
+                                                      Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                    <-Reducer 5 [CUSTOM_SIMPLE_EDGE]
+                                                      PARTITION_ONLY_SHUFFLE [RS_170]
+                                                        Group By Operator [GBY_169] (rows=1 width=12)
+                                                          Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                          Select Operator [SEL_168] (rows=155827 width=4)
+                                                            Output:["_col0"]
+                                                             Please refer to the previous Merge Join Operator [MERGEJOIN_184]
 
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query11.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query11.q.out
index b4231d8..ecc69e3 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query11.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query11.q.out
@@ -192,17 +192,17 @@ Stage-0
       File Output Operator [FS_350]
         Limit [LIM_349] (rows=100 width=85)
           Number of rows:100
-          Select Operator [SEL_348] (rows=19066162 width=85)
+          Select Operator [SEL_348] (rows=12248094 width=85)
             Output:["_col0"]
           <-Reducer 7 [SIMPLE_EDGE]
             SHUFFLE [RS_89]
-              Select Operator [SEL_88] (rows=19066162 width=85)
+              Select Operator [SEL_88] (rows=12248094 width=85)
                 Output:["_col0"]
-                Top N Key Operator [TNK_154] (rows=19066162 width=537)
+                Top N Key Operator [TNK_154] (rows=12248094 width=537)
                   keys:_col8,top n:100
-                  Filter Operator [FIL_87] (rows=19066162 width=537)
+                  Filter Operator [FIL_87] (rows=12248094 width=537)
                     predicate:CASE WHEN (_col4 is not null) THEN (CASE WHEN (_col2) THEN (((_col6 / _col1) > (_col9 / _col4))) ELSE (false) END) ELSE (false) END
-                    Merge Join Operator [MERGEJOIN_284] (rows=38132324 width=537)
+                    Merge Join Operator [MERGEJOIN_284] (rows=24496188 width=537)
                       Conds:RS_84._col3=RS_347._col0(Inner),Output:["_col1","_col2","_col4","_col6","_col8","_col9"]
                     <-Reducer 20 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_347]
@@ -216,7 +216,7 @@ Stage-0
                               PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                               Group By Operator [GBY_74] (rows=80000000 width=764)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                Merge Join Operator [MERGEJOIN_281] (rows=525327388 width=764)
+                                Merge Join Operator [MERGEJOIN_281] (rows=187573258 width=764)
                                   Conds:RS_70._col1=RS_313._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                 <-Map 26 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_313]
@@ -228,7 +228,7 @@ Stage-0
                                 <-Reducer 18 [SIMPLE_EDGE]
                                   SHUFFLE [RS_70]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_280] (rows=525327388 width=115)
+                                    Merge Join Operator [MERGEJOIN_280] (rows=187573258 width=115)
                                       Conds:RS_344._col0=RS_291._col0(Inner),Output:["_col1","_col2"]
                                     <-Map 21 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_291]
@@ -262,21 +262,21 @@ Stage-0
                     <-Reducer 6 [SIMPLE_EDGE]
                       SHUFFLE [RS_84]
                         PartitionCols:_col3
-                        Merge Join Operator [MERGEJOIN_283] (rows=31888273 width=440)
+                        Merge Join Operator [MERGEJOIN_283] (rows=20485012 width=440)
                           Conds:RS_81._col3=RS_339._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6"]
                         <-Reducer 16 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_339]
                             PartitionCols:_col0
-                            Select Operator [SEL_338] (rows=80000000 width=212)
+                            Select Operator [SEL_338] (rows=51391963 width=212)
                               Output:["_col0","_col1"]
-                              Group By Operator [GBY_337] (rows=80000000 width=764)
+                              Group By Operator [GBY_337] (rows=51391963 width=764)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
                               <-Reducer 15 [SIMPLE_EDGE]
                                 SHUFFLE [RS_56]
                                   PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
-                                  Group By Operator [GBY_55] (rows=80000000 width=764)
+                                  Group By Operator [GBY_55] (rows=51391963 width=764)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                    Merge Join Operator [MERGEJOIN_279] (rows=143930993 width=764)
+                                    Merge Join Operator [MERGEJOIN_279] (rows=51391963 width=764)
                                       Conds:RS_51._col1=RS_314._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                     <-Map 26 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_314]
@@ -285,7 +285,7 @@ Stage-0
                                     <-Reducer 14 [SIMPLE_EDGE]
                                       SHUFFLE [RS_51]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_278] (rows=143930993 width=115)
+                                        Merge Join Operator [MERGEJOIN_278] (rows=51391963 width=115)
                                           Conds:RS_336._col0=RS_293._col0(Inner),Output:["_col1","_col2"]
                                         <-Map 21 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_293]
@@ -314,7 +314,7 @@ Stage-0
                         <-Reducer 5 [SIMPLE_EDGE]
                           SHUFFLE [RS_81]
                             PartitionCols:_col3
-                            Merge Join Operator [MERGEJOIN_282] (rows=26666666 width=328)
+                            Merge Join Operator [MERGEJOIN_282] (rows=17130654 width=328)
                               Conds:RS_321._col0=RS_331._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                             <-Reducer 12 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_331]
@@ -332,7 +332,7 @@ Stage-0
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                                           Group By Operator [GBY_35] (rows=80000000 width=764)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                            Merge Join Operator [MERGEJOIN_277] (rows=525327388 width=764)
+                                            Merge Join Operator [MERGEJOIN_277] (rows=187573258 width=764)
                                               Conds:RS_31._col1=RS_316._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_316]
@@ -341,7 +341,7 @@ Stage-0
                                             <-Reducer 10 [SIMPLE_EDGE]
                                               SHUFFLE [RS_31]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_276] (rows=525327388 width=115)
+                                                Merge Join Operator [MERGEJOIN_276] (rows=187573258 width=115)
                                                   Conds:RS_326._col0=RS_297._col0(Inner),Output:["_col1","_col2"]
                                                 <-Map 21 [SIMPLE_EDGE] vectorized
                                                   PARTITION_ONLY_SHUFFLE [RS_297]
@@ -374,20 +374,20 @@ Stage-0
                             <-Reducer 4 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_321]
                                 PartitionCols:_col0
-                                Select Operator [SEL_320] (rows=26666666 width=216)
+                                Select Operator [SEL_320] (rows=17130654 width=216)
                                   Output:["_col0","_col1","_col2"]
-                                  Filter Operator [FIL_319] (rows=26666666 width=212)
+                                  Filter Operator [FIL_319] (rows=17130654 width=212)
                                     predicate:(_col7 > 0)
-                                    Select Operator [SEL_318] (rows=80000000 width=212)
+                                    Select Operator [SEL_318] (rows=51391963 width=212)
                                       Output:["_col0","_col7"]
-                                      Group By Operator [GBY_317] (rows=80000000 width=764)
+                                      Group By Operator [GBY_317] (rows=51391963 width=764)
                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
                                       <-Reducer 3 [SIMPLE_EDGE]
                                         SHUFFLE [RS_16]
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
-                                          Group By Operator [GBY_15] (rows=80000000 width=764)
+                                          Group By Operator [GBY_15] (rows=51391963 width=764)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                            Merge Join Operator [MERGEJOIN_275] (rows=143930993 width=764)
+                                            Merge Join Operator [MERGEJOIN_275] (rows=51391963 width=764)
                                               Conds:RS_11._col1=RS_315._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_315]
@@ -396,7 +396,7 @@ Stage-0
                                             <-Reducer 2 [SIMPLE_EDGE]
                                               SHUFFLE [RS_11]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_274] (rows=143930993 width=115)
+                                                Merge Join Operator [MERGEJOIN_274] (rows=51391963 width=115)
                                                   Conds:RS_311._col0=RS_295._col0(Inner),Output:["_col1","_col2"]
                                                 <-Map 21 [SIMPLE_EDGE] vectorized
                                                   PARTITION_ONLY_SHUFFLE [RS_295]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query12.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query12.q.out
index f894d09..86e17ea 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query12.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query12.q.out
@@ -95,23 +95,23 @@ Stage-0
             SHUFFLE [RS_80]
               Select Operator [SEL_79] (rows=138600 width=801)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                Top N Key Operator [TNK_78] (rows=138600 width=690)
+                Top N Key Operator [TNK_78] (rows=138600 width=689)
                   keys:_col0, _col1, _col2, _col3, ((_col5 * 100) / sum_window_0),top n:100
-                  PTF Operator [PTF_77] (rows=138600 width=690)
+                  PTF Operator [PTF_77] (rows=138600 width=689)
                     Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col1"}]
-                    Select Operator [SEL_76] (rows=138600 width=690)
+                    Select Operator [SEL_76] (rows=138600 width=689)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                     <-Reducer 4 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_75]
                         PartitionCols:_col1
-                        Group By Operator [GBY_74] (rows=138600 width=690)
+                        Group By Operator [GBY_74] (rows=138600 width=689)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_17]
                             PartitionCols:_col0, _col1, _col2, _col3, _col4
-                            Group By Operator [GBY_16] (rows=138600 width=690)
+                            Group By Operator [GBY_16] (rows=138600 width=689)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)"],keys:_col9, _col8, _col5, _col6, _col7
-                              Merge Join Operator [MERGEJOIN_59] (rows=43190061 width=689)
+                              Merge Join Operator [MERGEJOIN_59] (rows=4798568 width=689)
                                 Conds:RS_12._col1=RS_73._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9"]
                               <-Map 9 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_73]
@@ -125,7 +125,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_12]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_58] (rows=143966864 width=115)
+                                  Merge Join Operator [MERGEJOIN_58] (rows=15995224 width=115)
                                     Conds:RS_70._col0=RS_62._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 7 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_62]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query13.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query13.q.out
index b23af5e..c6274c0 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query13.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query13.q.out
@@ -137,11 +137,11 @@ Stage-0
             PARTITION_ONLY_SHUFFLE [RS_31]
               Group By Operator [GBY_30] (rows=1 width=256)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","count(_col4)","sum(_col5)","count(_col5)","sum(_col6)","count(_col6)"]
-                Select Operator [SEL_29] (rows=11734953 width=215)
+                Select Operator [SEL_29] (rows=368553 width=44)
                   Output:["_col4","_col5","_col6"]
-                  Filter Operator [FIL_28] (rows=11734953 width=215)
+                  Filter Operator [FIL_28] (rows=368553 width=44)
                     predicate:((_col19 and _col20 and _col10 and _col26) or (_col21 and _col22 and _col11 and _col27) or (_col23 and _col24 and _col12 and _col27))
-                    Merge Join Operator [MERGEJOIN_97] (rows=62586416 width=215)
+                    Merge Join Operator [MERGEJOIN_97] (rows=1965626 width=44)
                       Conds:RS_25._col2=RS_117._col0(Inner),Output:["_col4","_col5","_col6","_col10","_col11","_col12","_col19","_col20","_col21","_col22","_col23","_col24","_col26","_col27"]
                     <-Map 11 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_117]
@@ -155,7 +155,7 @@ Stage-0
                     <-Reducer 4 [SIMPLE_EDGE]
                       SHUFFLE [RS_25]
                         PartitionCols:_col2
-                        Merge Join Operator [MERGEJOIN_96] (rows=62586416 width=210)
+                        Merge Join Operator [MERGEJOIN_96] (rows=10811694 width=36)
                           Conds:RS_22._col1=RS_114._col0(Inner),Output:["_col2","_col4","_col5","_col6","_col10","_col11","_col12","_col19","_col20","_col21","_col22","_col23","_col24"]
                         <-Map 10 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_114]
@@ -169,9 +169,9 @@ Stage-0
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_22]
                             PartitionCols:_col1
-                            Filter Operator [FIL_21] (rows=343170969 width=261)
+                            Filter Operator [FIL_21] (rows=10811694 width=36)
                               predicate:((_col15 and _col7) or (_col16 and _col8) or (_col17 and _col9))
-                              Merge Join Operator [MERGEJOIN_95] (rows=457561292 width=261)
+                              Merge Join Operator [MERGEJOIN_95] (rows=14415593 width=36)
                                 Conds:RS_18._col3=RS_111._col0(Inner),Output:["_col1","_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17"]
                               <-Map 9 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_111]
@@ -185,7 +185,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_18]
                                   PartitionCols:_col3
-                                  Merge Join Operator [MERGEJOIN_94] (rows=457561292 width=253)
+                                  Merge Join Operator [MERGEJOIN_94] (rows=163376714 width=233)
                                     Conds:RS_108._col0=RS_100._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
                                   <-Map 7 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_100]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query14.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query14.q.out
index 69c570f..8204245 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query14.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query14.q.out
@@ -299,42 +299,42 @@ Stage-0
       File Output Operator [FS_1366]
         Limit [LIM_1365] (rows=100 width=223)
           Number of rows:100
-          Select Operator [SEL_1364] (rows=304320 width=223)
+          Select Operator [SEL_1364] (rows=304320 width=222)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 8 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_1363]
-              Select Operator [SEL_1362] (rows=304320 width=223)
+              Select Operator [SEL_1362] (rows=304320 width=222)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                Group By Operator [GBY_1361] (rows=304320 width=231)
+                Group By Operator [GBY_1361] (rows=304320 width=230)
                   Output:["_col0","_col1","_col2","_col3","_col5","_col6"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                 <-Union 7 [SIMPLE_EDGE]
                   <-Reducer 16 [CONTAINS]
                     Reduce Output Operator [RS_1209]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_1208] (rows=304320 width=231)
+                      Group By Operator [GBY_1208] (rows=304320 width=230)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3, 0L
-                        Top N Key Operator [TNK_1207] (rows=121728 width=221)
+                        Top N Key Operator [TNK_1207] (rows=121728 width=220)
                           keys:_col0, _col1, _col2, _col3,top n:100
-                          Select Operator [SEL_1205] (rows=40576 width=223)
+                          Select Operator [SEL_1205] (rows=40576 width=222)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                            Filter Operator [FIL_1204] (rows=40576 width=244)
+                            Filter Operator [FIL_1204] (rows=40576 width=243)
                               predicate:(_col3 > _col5)
-                              Merge Join Operator [MERGEJOIN_1203] (rows=121728 width=244)
+                              Merge Join Operator [MERGEJOIN_1203] (rows=121728 width=243)
                                 Conds:(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                               <-Reducer 15 [CUSTOM_SIMPLE_EDGE] vectorized
                                 PARTITION_ONLY_SHUFFLE [RS_1378]
-                                  Filter Operator [FIL_1377] (rows=121728 width=132)
+                                  Filter Operator [FIL_1377] (rows=121728 width=131)
                                     predicate:_col3 is not null
-                                    Group By Operator [GBY_1376] (rows=121728 width=132)
+                                    Group By Operator [GBY_1376] (rows=121728 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2
                                     <-Reducer 14 [SIMPLE_EDGE]
                                       SHUFFLE [RS_238]
                                         PartitionCols:_col0, _col1, _col2
-                                        Group By Operator [GBY_237] (rows=17407104 width=131)
+                                        Group By Operator [GBY_237] (rows=486912 width=131)
                                           Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col3)","count()"],keys:_col0, _col1, _col2
-                                          Select Operator [SEL_235] (rows=286549727 width=127)
+                                          Select Operator [SEL_235] (rows=7790806 width=106)
                                             Output:["_col0","_col1","_col2","_col3"]
-                                            Merge Join Operator [MERGEJOIN_1176] (rows=286549727 width=127)
+                                            Merge Join Operator [MERGEJOIN_1176] (rows=7790806 width=106)
                                               Conds:RS_232._col1=RS_1344._col0(Inner),Output:["_col2","_col3","_col7","_col8","_col9"]
                                             <-Map 65 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_1344]
@@ -346,12 +346,12 @@ Stage-0
                                             <-Reducer 13 [SIMPLE_EDGE]
                                               SHUFFLE [RS_232]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_1175] (rows=286549727 width=119)
+                                                Merge Join Operator [MERGEJOIN_1175] (rows=7790806 width=98)
                                                   Conds:RS_229._col1=RS_230._col0(Inner),Output:["_col1","_col2","_col3"]
                                                 <-Reducer 12 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_229]
                                                     PartitionCols:_col1
-                                                    Merge Join Operator [MERGEJOIN_1167] (rows=286549727 width=119)
+                                                    Merge Join Operator [MERGEJOIN_1167] (rows=7790806 width=98)
                                                       Conds:RS_1371._col0=RS_1311._col0(Inner),Output:["_col1","_col2","_col3"]
                                                     <-Map 10 [SIMPLE_EDGE] vectorized
                                                       PARTITION_ONLY_SHUFFLE [RS_1311]
@@ -385,7 +385,7 @@ Stage-0
                                                 <-Reducer 34 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_230]
                                                     PartitionCols:_col0
-                                                    Merge Join Operator [MERGEJOIN_1174] (rows=729 width=4)
+                                                    Merge Join Operator [MERGEJOIN_1174] (rows=724 width=4)
                                                       Conds:RS_1352._col1, _col2, _col3=RS_1375._col0, _col1, _col2(Inner),Output:["_col0"]
                                                     <-Map 65 [SIMPLE_EDGE] vectorized
                                                       SHUFFLE [RS_1352]
@@ -402,22 +402,22 @@ Stage-0
                                                           Output:["_col0","_col1","_col2"]
                                                           Filter Operator [FIL_1373] (rows=1 width=20)
                                                             predicate:(_col3 = 3L)
-                                                            Group By Operator [GBY_1372] (rows=120960 width=20)
+                                                            Group By Operator [GBY_1372] (rows=121728 width=19)
                                                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                             <-Union 32 [SIMPLE_EDGE]
                                                               <-Reducer 31 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1429]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1428] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1428] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1427] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1427] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 26 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_169]
                                                                         PartitionCols:_col0, _col1, _col2
-                                                                        Group By Operator [GBY_25] (rows=3144960 width=19)
+                                                                        Group By Operator [GBY_25] (rows=121728 width=19)
                                                                           Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col4, _col5, _col6
-                                                                          Merge Join Operator [MERGEJOIN_1156] (rows=546042657 width=11)
+                                                                          Merge Join Operator [MERGEJOIN_1156] (rows=14628613 width=11)
                                                                             Conds:RS_21._col1=RS_1349._col0(Inner),Output:["_col4","_col5","_col6"]
                                                                           <-Map 65 [SIMPLE_EDGE] vectorized
                                                                             SHUFFLE [RS_1349]
@@ -430,7 +430,7 @@ Stage-0
                                                                           <-Reducer 25 [SIMPLE_EDGE]
                                                                             SHUFFLE [RS_21]
                                                                               PartitionCols:_col1
-                                                                              Merge Join Operator [MERGEJOIN_1155] (rows=550076554 width=4)
+                                                                              Merge Join Operator [MERGEJOIN_1155] (rows=14736682 width=4)
                                                                                 Conds:RS_1423._col0=RS_1401._col0(Inner),Output:["_col1"]
                                                                               <-Map 39 [SIMPLE_EDGE] vectorized
                                                                                 SHUFFLE [RS_1401]
@@ -464,16 +464,16 @@ Stage-0
                                                               <-Reducer 44 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1443]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1442] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1442] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1441] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1441] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 42 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_189]
                                                                         PartitionCols:_col0, _col1, _col2
-                                                                        Group By Operator [GBY_45] (rows=1693440 width=19)
+                                                                        Group By Operator [GBY_45] (rows=121728 width=19)
                                                                           Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col4, _col5, _col6
-                                                                          Merge Join Operator [MERGEJOIN_1158] (rows=284448361 width=11)
+                                                                          Merge Join Operator [MERGEJOIN_1158] (rows=7620440 width=11)
                                                                             Conds:RS_41._col1=RS_1350._col0(Inner),Output:["_col4","_col5","_col6"]
                                                                           <-Map 65 [SIMPLE_EDGE] vectorized
                                                                             SHUFFLE [RS_1350]
@@ -486,7 +486,7 @@ Stage-0
                                                                           <-Reducer 41 [SIMPLE_EDGE]
                                                                             SHUFFLE [RS_41]
                                                                               PartitionCols:_col1
-                                                                              Merge Join Operator [MERGEJOIN_1157] (rows=286549727 width=4)
+                                                                              Merge Join Operator [MERGEJOIN_1157] (rows=7676736 width=4)
                                                                                 Conds:RS_1437._col0=RS_1403._col0(Inner),Output:["_col1"]
                                                                               <-Map 39 [SIMPLE_EDGE] vectorized
                                                                                 SHUFFLE [RS_1403]
@@ -515,16 +515,16 @@ Stage-0
                                                               <-Reducer 50 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1457]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1456] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1456] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1455] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1455] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 48 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_210]
                                                                         PartitionCols:_col0, _col1, _col2
-                                                                        Group By Operator [GBY_66] (rows=846720 width=19)
+                                                                        Group By Operator [GBY_66] (rows=121728 width=19)
                                                                           Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col4, _col5, _col6
-                                                                          Merge Join Operator [MERGEJOIN_1160] (rows=142911107 width=11)
+                                                                          Merge Join Operator [MERGEJOIN_1160] (rows=3828623 width=11)
                                                                             Conds:RS_62._col1=RS_1351._col0(Inner),Output:["_col4","_col5","_col6"]
                                                                           <-Map 65 [SIMPLE_EDGE] vectorized
                                                                             SHUFFLE [RS_1351]
@@ -537,7 +537,7 @@ Stage-0
                                                                           <-Reducer 47 [SIMPLE_EDGE]
                                                                             SHUFFLE [RS_62]
                                                                               PartitionCols:_col1
-                                                                              Merge Join Operator [MERGEJOIN_1159] (rows=143966864 width=4)
+                                                                              Merge Join Operator [MERGEJOIN_1159] (rows=3856907 width=4)
                                                                                 Conds:RS_1451._col0=RS_1405._col0(Inner),Output:["_col1"]
                                                                               <-Map 39 [SIMPLE_EDGE] vectorized
                                                                                 SHUFFLE [RS_1405]
@@ -576,11 +576,11 @@ Stage-0
                                           Reduce Output Operator [RS_1264]
                                             Group By Operator [GBY_1263] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1262] (rows=980593145 width=112)
+                                              Select Operator [SEL_1262] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1260] (rows=550076554 width=110)
+                                                Select Operator [SEL_1260] (rows=14736682 width=0)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1259] (rows=550076554 width=110)
+                                                  Merge Join Operator [MERGEJOIN_1259] (rows=14736682 width=0)
                                                     Conds:RS_1466._col0=RS_1409._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 39 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_1409]
@@ -610,11 +610,11 @@ Stage-0
                                           Reduce Output Operator [RS_1282]
                                             Group By Operator [GBY_1281] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1280] (rows=980593145 width=112)
+                                              Select Operator [SEL_1280] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1278] (rows=286549727 width=115)
+                                                Select Operator [SEL_1278] (rows=7676736 width=94)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1277] (rows=286549727 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1277] (rows=7676736 width=94)
                                                     Conds:RS_1481._col0=RS_1472._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 71 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1472]
@@ -649,11 +649,11 @@ Stage-0
                                           Reduce Output Operator [RS_1300]
                                             Group By Operator [GBY_1299] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1298] (rows=980593145 width=112)
+                                              Select Operator [SEL_1298] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1296] (rows=143966864 width=115)
+                                                Select Operator [SEL_1296] (rows=3856907 width=114)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1295] (rows=143966864 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1295] (rows=3856907 width=114)
                                                     Conds:RS_1496._col0=RS_1487._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 77 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1487]
@@ -687,30 +687,30 @@ Stage-0
                   <-Reducer 22 [CONTAINS]
                     Reduce Output Operator [RS_1216]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_1215] (rows=304320 width=231)
+                      Group By Operator [GBY_1215] (rows=304320 width=230)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3, 0L
-                        Top N Key Operator [TNK_1214] (rows=121728 width=221)
+                        Top N Key Operator [TNK_1214] (rows=121728 width=220)
                           keys:_col0, _col1, _col2, _col3,top n:100
-                          Select Operator [SEL_1212] (rows=40576 width=219)
+                          Select Operator [SEL_1212] (rows=40576 width=218)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                            Filter Operator [FIL_1211] (rows=40576 width=244)
+                            Filter Operator [FIL_1211] (rows=40576 width=243)
                               predicate:(_col3 > _col5)
-                              Merge Join Operator [MERGEJOIN_1210] (rows=121728 width=244)
+                              Merge Join Operator [MERGEJOIN_1210] (rows=121728 width=243)
                                 Conds:(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                               <-Reducer 21 [CUSTOM_SIMPLE_EDGE] vectorized
                                 PARTITION_ONLY_SHUFFLE [RS_1394]
-                                  Filter Operator [FIL_1393] (rows=121728 width=132)
+                                  Filter Operator [FIL_1393] (rows=121728 width=131)
                                     predicate:_col3 is not null
-                                    Group By Operator [GBY_1392] (rows=121728 width=132)
+                                    Group By Operator [GBY_1392] (rows=121728 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2
                                     <-Reducer 20 [SIMPLE_EDGE]
                                       SHUFFLE [RS_382]
                                         PartitionCols:_col0, _col1, _col2
-                                        Group By Operator [GBY_381] (rows=8764416 width=131)
+                                        Group By Operator [GBY_381] (rows=243456 width=131)
                                           Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col3)","count()"],keys:_col0, _col1, _col2
-                                          Select Operator [SEL_379] (rows=143966864 width=127)
+                                          Select Operator [SEL_379] (rows=3942084 width=126)
                                             Output:["_col0","_col1","_col2","_col3"]
-                                            Merge Join Operator [MERGEJOIN_1189] (rows=143966864 width=127)
+                                            Merge Join Operator [MERGEJOIN_1189] (rows=3942084 width=126)
                                               Conds:RS_376._col1=RS_1346._col0(Inner),Output:["_col2","_col3","_col7","_col8","_col9"]
                                             <-Map 65 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_1346]
@@ -721,12 +721,12 @@ Stage-0
                                             <-Reducer 19 [SIMPLE_EDGE]
                                               SHUFFLE [RS_376]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_1188] (rows=143966864 width=119)
+                                                Merge Join Operator [MERGEJOIN_1188] (rows=3942084 width=118)
                                                   Conds:RS_373._col1=RS_374._col0(Inner),Output:["_col1","_col2","_col3"]
                                                 <-Reducer 18 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_373]
                                                     PartitionCols:_col1
-                                                    Merge Join Operator [MERGEJOIN_1180] (rows=143966864 width=119)
+                                                    Merge Join Operator [MERGEJOIN_1180] (rows=3942084 width=118)
                                                       Conds:RS_1387._col0=RS_1313._col0(Inner),Output:["_col1","_col2","_col3"]
                                                     <-Map 10 [SIMPLE_EDGE] vectorized
                                                       PARTITION_ONLY_SHUFFLE [RS_1313]
@@ -755,7 +755,7 @@ Stage-0
                                                 <-Reducer 38 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_374]
                                                     PartitionCols:_col0
-                                                    Merge Join Operator [MERGEJOIN_1187] (rows=729 width=4)
+                                                    Merge Join Operator [MERGEJOIN_1187] (rows=724 width=4)
                                                       Conds:RS_1353._col1, _col2, _col3=RS_1391._col0, _col1, _col2(Inner),Output:["_col0"]
                                                     <-Map 65 [SIMPLE_EDGE] vectorized
                                                       SHUFFLE [RS_1353]
@@ -772,15 +772,15 @@ Stage-0
                                                           Output:["_col0","_col1","_col2"]
                                                           Filter Operator [FIL_1389] (rows=1 width=20)
                                                             predicate:(_col3 = 3L)
-                                                            Group By Operator [GBY_1388] (rows=120960 width=20)
+                                                            Group By Operator [GBY_1388] (rows=121728 width=19)
                                                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                             <-Union 36 [SIMPLE_EDGE]
                                                               <-Reducer 35 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1432]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1431] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1431] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1430] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1430] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 26 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_313]
@@ -789,9 +789,9 @@ Stage-0
                                                               <-Reducer 45 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1446]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1445] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1445] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1444] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1444] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 42 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_333]
@@ -800,9 +800,9 @@ Stage-0
                                                               <-Reducer 51 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1460]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1459] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1459] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1458] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1458] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 48 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_354]
@@ -821,11 +821,11 @@ Stage-0
                                           Reduce Output Operator [RS_1270]
                                             Group By Operator [GBY_1269] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1268] (rows=980593145 width=112)
+                                              Select Operator [SEL_1268] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1266] (rows=550076554 width=110)
+                                                Select Operator [SEL_1266] (rows=14736682 width=0)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1265] (rows=550076554 width=110)
+                                                  Merge Join Operator [MERGEJOIN_1265] (rows=14736682 width=0)
                                                     Conds:RS_1467._col0=RS_1410._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 39 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_1410]
@@ -839,11 +839,11 @@ Stage-0
                                           Reduce Output Operator [RS_1288]
                                             Group By Operator [GBY_1287] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1286] (rows=980593145 width=112)
+                                              Select Operator [SEL_1286] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1284] (rows=286549727 width=115)
+                                                Select Operator [SEL_1284] (rows=7676736 width=94)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1283] (rows=286549727 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1283] (rows=7676736 width=94)
                                                     Conds:RS_1482._col0=RS_1473._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 71 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1473]
@@ -857,11 +857,11 @@ Stage-0
                                           Reduce Output Operator [RS_1306]
                                             Group By Operator [GBY_1305] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1304] (rows=980593145 width=112)
+                                              Select Operator [SEL_1304] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1302] (rows=143966864 width=115)
+                                                Select Operator [SEL_1302] (rows=3856907 width=114)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1301] (rows=143966864 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1301] (rows=3856907 width=114)
                                                     Conds:RS_1497._col0=RS_1488._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 77 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1488]
@@ -874,30 +874,30 @@ Stage-0
                   <-Reducer 6 [CONTAINS]
                     Reduce Output Operator [RS_1202]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_1201] (rows=304320 width=231)
+                      Group By Operator [GBY_1201] (rows=304320 width=230)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3, 0L
-                        Top N Key Operator [TNK_1200] (rows=121728 width=221)
+                        Top N Key Operator [TNK_1200] (rows=121728 width=220)
                           keys:_col0, _col1, _col2, _col3,top n:100
-                          Select Operator [SEL_1198] (rows=40576 width=221)
+                          Select Operator [SEL_1198] (rows=40576 width=220)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                            Filter Operator [FIL_1197] (rows=40576 width=244)
+                            Filter Operator [FIL_1197] (rows=40576 width=243)
                               predicate:(_col3 > _col5)
-                              Merge Join Operator [MERGEJOIN_1196] (rows=121728 width=244)
+                              Merge Join Operator [MERGEJOIN_1196] (rows=121728 width=243)
                                 Conds:(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                               <-Reducer 5 [CUSTOM_SIMPLE_EDGE] vectorized
                                 PARTITION_ONLY_SHUFFLE [RS_1356]
-                                  Filter Operator [FIL_1355] (rows=121728 width=132)
+                                  Filter Operator [FIL_1355] (rows=121728 width=131)
                                     predicate:_col3 is not null
-                                    Group By Operator [GBY_1354] (rows=121728 width=132)
+                                    Group By Operator [GBY_1354] (rows=121728 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2
                                     <-Reducer 4 [SIMPLE_EDGE]
                                       SHUFFLE [RS_95]
                                         PartitionCols:_col0, _col1, _col2
-                                        Group By Operator [GBY_94] (rows=32136192 width=131)
+                                        Group By Operator [GBY_94] (rows=121728 width=131)
                                           Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col3)","count()"],keys:_col0, _col1, _col2
-                                          Select Operator [SEL_92] (rows=550076554 width=122)
+                                          Select Operator [SEL_92] (rows=15062131 width=11)
                                             Output:["_col0","_col1","_col2","_col3"]
-                                            Merge Join Operator [MERGEJOIN_1163] (rows=550076554 width=122)
+                                            Merge Join Operator [MERGEJOIN_1163] (rows=15062131 width=11)
                                               Conds:RS_89._col1=RS_1339._col0(Inner),Output:["_col2","_col3","_col7","_col8","_col9"]
                                             <-Map 65 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_1339]
@@ -908,12 +908,12 @@ Stage-0
                                             <-Reducer 3 [SIMPLE_EDGE]
                                               SHUFFLE [RS_89]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_1162] (rows=550076554 width=114)
+                                                Merge Join Operator [MERGEJOIN_1162] (rows=15062131 width=4)
                                                   Conds:RS_86._col1=RS_87._col0(Inner),Output:["_col1","_col2","_col3"]
                                                 <-Reducer 2 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_86]
                                                     PartitionCols:_col1
-                                                    Merge Join Operator [MERGEJOIN_1154] (rows=550076554 width=114)
+                                                    Merge Join Operator [MERGEJOIN_1154] (rows=15062131 width=4)
                                                       Conds:RS_1325._col0=RS_1309._col0(Inner),Output:["_col1","_col2","_col3"]
                                                     <-Map 10 [SIMPLE_EDGE] vectorized
                                                       PARTITION_ONLY_SHUFFLE [RS_1309]
@@ -942,7 +942,7 @@ Stage-0
                                                 <-Reducer 30 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_87]
                                                     PartitionCols:_col0
-                                                    Merge Join Operator [MERGEJOIN_1161] (rows=729 width=4)
+                                                    Merge Join Operator [MERGEJOIN_1161] (rows=724 width=4)
                                                       Conds:RS_1348._col1, _col2, _col3=RS_1329._col0, _col1, _col2(Inner),Output:["_col0"]
                                                     <-Map 65 [SIMPLE_EDGE] vectorized
                                                       SHUFFLE [RS_1348]
@@ -959,15 +959,15 @@ Stage-0
                                                           Output:["_col0","_col1","_col2"]
                                                           Filter Operator [FIL_1327] (rows=1 width=20)
                                                             predicate:(_col3 = 3L)
-                                                            Group By Operator [GBY_1326] (rows=120960 width=20)
+                                                            Group By Operator [GBY_1326] (rows=121728 width=19)
                                                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                             <-Union 28 [SIMPLE_EDGE]
                                                               <-Reducer 27 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1426]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1425] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1425] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1424] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1424] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 26 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_26]
@@ -976,9 +976,9 @@ Stage-0
                                                               <-Reducer 43 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1440]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1439] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1439] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1438] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1438] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 42 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_46]
@@ -987,9 +987,9 @@ Stage-0
                                                               <-Reducer 49 [CONTAINS] vectorized
                                                                 Reduce Output Operator [RS_1454]
                                                                   PartitionCols:_col0, _col1, _col2
-                                                                  Group By Operator [GBY_1453] (rows=120960 width=20)
+                                                                  Group By Operator [GBY_1453] (rows=121728 width=19)
                                                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                                                                    Group By Operator [GBY_1452] (rows=120960 width=20)
+                                                                    Group By Operator [GBY_1452] (rows=121728 width=19)
                                                                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                                                     <-Reducer 48 [SIMPLE_EDGE]
                                                                       SHUFFLE [RS_67]
@@ -1008,11 +1008,11 @@ Stage-0
                                           Reduce Output Operator [RS_1258]
                                             Group By Operator [GBY_1257] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1256] (rows=980593145 width=112)
+                                              Select Operator [SEL_1256] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1254] (rows=550076554 width=110)
+                                                Select Operator [SEL_1254] (rows=14736682 width=0)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1253] (rows=550076554 width=110)
+                                                  Merge Join Operator [MERGEJOIN_1253] (rows=14736682 width=0)
                                                     Conds:RS_1465._col0=RS_1407._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 39 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_1407]
@@ -1026,11 +1026,11 @@ Stage-0
                                           Reduce Output Operator [RS_1276]
                                             Group By Operator [GBY_1275] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1274] (rows=980593145 width=112)
+                                              Select Operator [SEL_1274] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1272] (rows=286549727 width=115)
+                                                Select Operator [SEL_1272] (rows=7676736 width=94)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1271] (rows=286549727 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1271] (rows=7676736 width=94)
                                                     Conds:RS_1480._col0=RS_1470._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 71 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1470]
@@ -1044,11 +1044,11 @@ Stage-0
                                           Reduce Output Operator [RS_1294]
                                             Group By Operator [GBY_1293] (rows=1 width=120)
                                               Output:["_col0","_col1"],aggregations:["sum(_col0)","count(_col0)"]
-                                              Select Operator [SEL_1292] (rows=980593145 width=112)
+                                              Select Operator [SEL_1292] (rows=26270325 width=44)
                                                 Output:["_col0"]
-                                                Select Operator [SEL_1290] (rows=143966864 width=115)
+                                                Select Operator [SEL_1290] (rows=3856907 width=114)
                                                   Output:["_col0","_col1"]
-                                                  Merge Join Operator [MERGEJOIN_1289] (rows=143966864 width=115)
+                                                  Merge Join Operator [MERGEJOIN_1289] (rows=3856907 width=114)
                                                     Conds:RS_1495._col0=RS_1485._col0(Inner),Output:["_col1","_col2"]
                                                   <-Map 77 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_1485]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query15.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query15.q.out
index 6de127d..324ada8 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query15.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query15.q.out
@@ -65,24 +65,24 @@ Stage-0
       File Output Operator [FS_102]
         Limit [LIM_101] (rows=100 width=201)
           Number of rows:100
-          Select Operator [SEL_100] (rows=10141 width=201)
+          Select Operator [SEL_100] (rows=2555 width=201)
             Output:["_col0","_col1"]
           <-Reducer 4 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_99]
-              Group By Operator [GBY_98] (rows=10141 width=201)
+              Group By Operator [GBY_98] (rows=2555 width=201)
                 Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
               <-Reducer 3 [SIMPLE_EDGE]
                 SHUFFLE [RS_24]
                   PartitionCols:_col0
-                  Group By Operator [GBY_23] (rows=2403417 width=201)
+                  Group By Operator [GBY_23] (rows=43435 width=201)
                     Output:["_col0","_col1"],aggregations:["sum(_col8)"],keys:_col3
-                    Select Operator [SEL_22] (rows=285117831 width=212)
+                    Select Operator [SEL_22] (rows=20154874 width=205)
                       Output:["_col3","_col8"]
-                      Top N Key Operator [TNK_46] (rows=285117831 width=212)
+                      Top N Key Operator [TNK_46] (rows=20154874 width=205)
                         keys:_col3,top n:100
-                        Filter Operator [FIL_21] (rows=285117831 width=212)
+                        Filter Operator [FIL_21] (rows=20154874 width=205)
                           predicate:(_col9 or _col4 or _col5)
-                          Merge Join Operator [MERGEJOIN_81] (rows=285117831 width=212)
+                          Merge Join Operator [MERGEJOIN_81] (rows=20154874 width=205)
                             Conds:RS_18._col0=RS_19._col1(Inner),Output:["_col3","_col4","_col5","_col8","_col9"]
                           <-Reducer 2 [SIMPLE_EDGE]
                             SHUFFLE [RS_18]
@@ -108,7 +108,7 @@ Stage-0
                           <-Reducer 8 [SIMPLE_EDGE]
                             SHUFFLE [RS_19]
                               PartitionCols:_col1
-                              Merge Join Operator [MERGEJOIN_80] (rows=285117831 width=119)
+                              Merge Join Operator [MERGEJOIN_80] (rows=20154874 width=111)
                                 Conds:RS_97._col0=RS_89._col0(Inner),Output:["_col1","_col2","_col3"]
                               <-Map 9 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_89]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
index cc3d388e..f9b2dc1 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query16.q.out
@@ -73,80 +73,71 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Reducer 11 (BROADCAST_EDGE)
-Reducer 11 <- Map 10 (CUSTOM_SIMPLE_EDGE)
-Reducer 15 <- Map 14 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
-Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 13 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 15 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Map 1 <- Reducer 12 (BROADCAST_EDGE)
+Map 14 <- Reducer 9 (BROADCAST_EDGE)
+Reducer 12 <- Map 11 (CUSTOM_SIMPLE_EDGE)
+Reducer 16 <- Map 15 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 14 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 16 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
 Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 Reducer 8 <- Reducer 7 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 8 vectorized
-      File Output Operator [FS_156]
-        Group By Operator [GBY_155] (rows=1 width=232)
+      File Output Operator [FS_158]
+        Group By Operator [GBY_157] (rows=1 width=232)
           Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"]
         <-Reducer 7 [CUSTOM_SIMPLE_EDGE] vectorized
-          PARTITION_ONLY_SHUFFLE [RS_154]
-            Group By Operator [GBY_153] (rows=1 width=232)
+          PARTITION_ONLY_SHUFFLE [RS_156]
+            Group By Operator [GBY_155] (rows=1 width=232)
               Output:["_col0","_col1","_col2"],aggregations:["count(_col0)","sum(_col1)","sum(_col2)"]
-              Group By Operator [GBY_152] (rows=283695062 width=228)
+              Group By Operator [GBY_154] (rows=5150256 width=228)
                 Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
               <-Reducer 6 [SIMPLE_EDGE]
                 SHUFFLE [RS_69]
                   PartitionCols:_col0
-                  Group By Operator [GBY_68] (rows=283695062 width=228)
+                  Group By Operator [GBY_68] (rows=5150256 width=228)
                     Output:["_col0","_col2","_col3"],aggregations:["sum(_col5)","sum(_col6)"],keys:_col4
-                    Select Operator [SEL_41] (rows=283695062 width=228)
+                    Select Operator [SEL_41] (rows=5150256 width=214)
                       Output:["_col4","_col5","_col6"]
-                      Filter Operator [FIL_40] (rows=283695062 width=228)
+                      Filter Operator [FIL_40] (rows=5150256 width=214)
                         predicate:_col13 is null
-                        Merge Join Operator [MERGEJOIN_125] (rows=397917099 width=228)
-                          Conds:RS_37._col4=RS_151._col1(Left Outer),Output:["_col4","_col5","_col6","_col13"]
-                        <-Reducer 15 [SIMPLE_EDGE] vectorized
-                          SHUFFLE [RS_151]
+                        Merge Join Operator [MERGEJOIN_125] (rows=10300512 width=214)
+                          Conds:RS_37._col4=RS_153._col1(Left Outer),Output:["_col4","_col5","_col6","_col13"]
+                        <-Reducer 16 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_153]
                             PartitionCols:_col1
-                            Select Operator [SEL_150] (rows=18238808 width=8)
+                            Select Operator [SEL_152] (rows=18238808 width=8)
                               Output:["_col0","_col1"]
-                              Group By Operator [GBY_149] (rows=18238808 width=4)
+                              Group By Operator [GBY_151] (rows=18238808 width=4)
                                 Output:["_col0"],keys:KEY._col0
-                              <-Map 14 [SIMPLE_EDGE] vectorized
-                                SHUFFLE [RS_148]
+                              <-Map 15 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_150]
                                   PartitionCols:_col0
-                                  Group By Operator [GBY_147] (rows=28798881 width=4)
+                                  Group By Operator [GBY_149] (rows=28798881 width=4)
                                     Output:["_col0"],keys:cr_order_number
                                     TableScan [TS_25] (rows=28798881 width=4)
                                       default@catalog_returns,cr1,Tbl:COMPLETE,Col:COMPLETE,Output:["cr_order_number"]
                         <-Reducer 5 [SIMPLE_EDGE]
                           SHUFFLE [RS_37]
                             PartitionCols:_col4
-                            Select Operator [SEL_36] (rows=283695062 width=231)
+                            Select Operator [SEL_36] (rows=5150256 width=200)
                               Output:["_col4","_col5","_col6"]
-                              Merge Join Operator [MERGEJOIN_124] (rows=283695062 width=235)
-                                Conds:RS_33._col4=RS_146._col0(Left Semi),Output:["_col3","_col4","_col5","_col6","_col14"],residual filter predicates:{(_col3 <> _col14)}
-                              <-Map 13 [SIMPLE_EDGE] vectorized
-                                SHUFFLE [RS_146]
-                                  PartitionCols:_col0
-                                  Group By Operator [GBY_145] (rows=286548719 width=7)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                    Select Operator [SEL_144] (rows=286548719 width=7)
-                                      Output:["_col0","_col1"]
-                                      Filter Operator [FIL_143] (rows=286548719 width=7)
-                                        predicate:cs_warehouse_sk is not null
-                                        TableScan [TS_22] (rows=287989836 width=7)
-                                          default@catalog_sales,cs2,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_warehouse_sk","cs_order_number"]
+                              Merge Join Operator [MERGEJOIN_124] (rows=5150256 width=202)
+                                Conds:RS_33._col4=RS_148._col0(Left Semi),Output:["_col3","_col4","_col5","_col6","_col14"],residual filter predicates:{(_col3 <> _col14)}
                               <-Reducer 4 [SIMPLE_EDGE]
-                                SHUFFLE [RS_33]
+                                PARTITION_ONLY_SHUFFLE [RS_33]
                                   PartitionCols:_col4
-                                  Merge Join Operator [MERGEJOIN_123] (rows=283695062 width=231)
+                                  Merge Join Operator [MERGEJOIN_123] (rows=5150256 width=200)
                                     Conds:RS_18._col2=RS_142._col0(Inner),Output:["_col3","_col4","_col5","_col6"]
-                                  <-Map 12 [SIMPLE_EDGE] vectorized
+                                  <-Map 13 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_142]
                                       PartitionCols:_col0
                                       Select Operator [SEL_141] (rows=10 width=102)
@@ -158,9 +149,9 @@ Stage-0
                                   <-Reducer 3 [SIMPLE_EDGE]
                                     SHUFFLE [RS_18]
                                       PartitionCols:_col2
-                                      Merge Join Operator [MERGEJOIN_122] (rows=283695062 width=235)
+                                      Merge Join Operator [MERGEJOIN_122] (rows=30901534 width=230)
                                         Conds:RS_15._col1=RS_128._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
-                                      <-Map 10 [SIMPLE_EDGE] vectorized
+                                      <-Map 11 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_128]
                                           PartitionCols:_col0
                                           Select Operator [SEL_127] (rows=784314 width=90)
@@ -172,7 +163,7 @@ Stage-0
                                       <-Reducer 2 [SIMPLE_EDGE]
                                         SHUFFLE [RS_15]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_121] (rows=283695062 width=239)
+                                          Merge Join Operator [MERGEJOIN_121] (rows=31519516 width=234)
                                             Conds:RS_136._col0=RS_139._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6"]
                                           <-Map 1 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_136]
@@ -183,18 +174,18 @@ Stage-0
                                                   predicate:(cs_ship_date_sk is not null and cs_call_center_sk is not null and cs_ship_addr_sk is not null and cs_ship_addr_sk BETWEEN DynamicValue(RS_16_customer_address_ca_address_sk_min) AND DynamicValue(RS_16_customer_address_ca_address_sk_max) and in_bloom_filter(cs_ship_addr_sk, DynamicValue(RS_16_customer_address_ca_address_sk_bloom_filter)))
                                                   TableScan [TS_0] (rows=287989836 width=243)
                                                     default@catalog_sales,cs1,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_ship_date_sk","cs_ship_addr_sk","cs_call_center_sk","cs_warehouse_sk","cs_order_number","cs_ext_ship_cost","cs_net_profit"]
-                                                  <-Reducer 11 [BROADCAST_EDGE] vectorized
+                                                  <-Reducer 12 [BROADCAST_EDGE] vectorized
                                                     BROADCAST [RS_133]
                                                       Group By Operator [GBY_132] (rows=1 width=12)
                                                         Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                      <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                      <-Map 11 [CUSTOM_SIMPLE_EDGE] vectorized
                                                         SHUFFLE [RS_131]
                                                           Group By Operator [GBY_130] (rows=1 width=12)
                                                             Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
                                                             Select Operator [SEL_129] (rows=784314 width=4)
                                                               Output:["_col0"]
                                                                Please refer to the previous Select Operator [SEL_127]
-                                          <-Map 9 [SIMPLE_EDGE] vectorized
+                                          <-Map 10 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_139]
                                               PartitionCols:_col0
                                               Select Operator [SEL_138] (rows=8116 width=98)
@@ -203,4 +194,26 @@ Stage-0
                                                   predicate:CAST( d_date AS TIMESTAMP) BETWEEN TIMESTAMP'2001-04-01 00:00:00' AND TIMESTAMP'2001-05-31 00:00:00'
                                                   TableScan [TS_3] (rows=73049 width=98)
                                                     default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_date"]
+                              <-Map 14 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_148]
+                                  PartitionCols:_col0
+                                  Group By Operator [GBY_147] (rows=286548719 width=7)
+                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Select Operator [SEL_146] (rows=286548719 width=7)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_145] (rows=286548719 width=7)
+                                        predicate:(cs_warehouse_sk is not null and cs_order_number BETWEEN DynamicValue(RS_33_cs1_cs_order_number_min) AND DynamicValue(RS_33_cs1_cs_order_number_max) and in_bloom_filter(cs_order_number, DynamicValue(RS_33_cs1_cs_order_number_bloom_filter)))
+                                        TableScan [TS_22] (rows=287989836 width=7)
+                                          default@catalog_sales,cs2,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_warehouse_sk","cs_order_number"]
+                                        <-Reducer 9 [BROADCAST_EDGE] vectorized
+                                          BROADCAST [RS_144]
+                                            Group By Operator [GBY_143] (rows=1 width=12)
+                                              Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                            <-Reducer 4 [CUSTOM_SIMPLE_EDGE]
+                                              PARTITION_ONLY_SHUFFLE [RS_111]
+                                                Group By Operator [GBY_110] (rows=1 width=12)
+                                                  Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                  Select Operator [SEL_109] (rows=5150256 width=8)
+                                                    Output:["_col0"]
+                                                     Please refer to the previous Merge Join Operator [MERGEJOIN_123]
 
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query17.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query17.q.out
index 1a79527..8781989 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query17.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query17.q.out
@@ -125,24 +125,24 @@ Stage-0
       File Output Operator [FS_253]
         Limit [LIM_252] (rows=100 width=466)
           Number of rows:100
-          Select Operator [SEL_251] (rows=97302218301 width=466)
+          Select Operator [SEL_251] (rows=8581091679 width=466)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_250]
-              Select Operator [SEL_249] (rows=97302218301 width=466)
+              Select Operator [SEL_249] (rows=8581091679 width=466)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                Group By Operator [GBY_248] (rows=97302218301 width=466)
+                Group By Operator [GBY_248] (rows=8581091679 width=466)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","count(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)","sum(VALUE._col7)","count(VALUE._col8)","sum(VALUE._col9)","sum(VALUE._col10)","sum(VALUE._col11)"],keys:KEY._col0, KEY._col1, KEY._col2
                 <-Reducer 5 [SIMPLE_EDGE]
                   SHUFFLE [RS_48]
                     PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_47] (rows=97302218301 width=466)
+                    Group By Operator [GBY_47] (rows=8581091679 width=466)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["count(_col3)","sum(_col3)","sum(_col7)","sum(_col6)","count(_col4)","sum(_col4)","sum(_col9)","sum(_col8)","count(_col5)","sum(_col5)","sum(_col11)","sum(_col10)"],keys:_col0, _col1, _col2
-                      Select Operator [SEL_45] (rows=97302218301 width=381)
+                      Select Operator [SEL_45] (rows=8581091679 width=381)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
-                        Top N Key Operator [TNK_97] (rows=97302218301 width=381)
+                        Top N Key Operator [TNK_97] (rows=8581091679 width=381)
                           keys:_col21, _col22, _col19,top n:100
-                          Merge Join Operator [MERGEJOIN_215] (rows=97302218301 width=381)
+                          Merge Join Operator [MERGEJOIN_215] (rows=8581091679 width=381)
                             Conds:RS_42._col6=RS_247._col0(Inner),Output:["_col3","_col10","_col16","_col19","_col21","_col22"]
                           <-Map 17 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_247]
@@ -154,7 +154,7 @@ Stage-0
                           <-Reducer 4 [SIMPLE_EDGE]
                             SHUFFLE [RS_42]
                               PartitionCols:_col6
-                              Merge Join Operator [MERGEJOIN_214] (rows=97302218301 width=101)
+                              Merge Join Operator [MERGEJOIN_214] (rows=8581091679 width=101)
                                 Conds:RS_39._col8=RS_245._col0(Inner),Output:["_col3","_col6","_col10","_col16","_col19"]
                               <-Map 16 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_245]
@@ -166,17 +166,17 @@ Stage-0
                               <-Reducer 3 [SIMPLE_EDGE]
                                 SHUFFLE [RS_39]
                                   PartitionCols:_col8
-                                  Merge Join Operator [MERGEJOIN_213] (rows=97302218301 width=19)
+                                  Merge Join Operator [MERGEJOIN_213] (rows=8581091679 width=19)
                                     Conds:RS_36._col1, _col2=RS_37._col9, _col8(Inner),Output:["_col3","_col6","_col8","_col10","_col16"]
                                   <-Reducer 11 [SIMPLE_EDGE]
                                     SHUFFLE [RS_37]
                                       PartitionCols:_col9, _col8
-                                      Merge Join Operator [MERGEJOIN_212] (rows=478292911 width=23)
+                                      Merge Join Operator [MERGEJOIN_212] (rows=42605597 width=19)
                                         Conds:RS_25._col2, _col1, _col4=RS_26._col2, _col1, _col3(Inner),Output:["_col1","_col3","_col5","_col8","_col9","_col11"]
                                       <-Reducer 10 [SIMPLE_EDGE]
                                         SHUFFLE [RS_25]
                                           PartitionCols:_col2, _col1, _col4
-                                          Merge Join Operator [MERGEJOIN_210] (rows=501694138 width=19)
+                                          Merge Join Operator [MERGEJOIN_210] (rows=27749405 width=10)
                                             Conds:RS_240._col0=RS_224._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_224]
@@ -210,7 +210,7 @@ Stage-0
                                       <-Reducer 13 [SIMPLE_EDGE]
                                         SHUFFLE [RS_26]
                                           PartitionCols:_col2, _col1, _col3
-                                          Merge Join Operator [MERGEJOIN_211] (rows=53632139 width=15)
+                                          Merge Join Operator [MERGEJOIN_211] (rows=8143830 width=14)
                                             Conds:RS_243._col0=RS_226._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_226]
@@ -232,7 +232,7 @@ Stage-0
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_36]
                                       PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_209] (rows=285117831 width=11)
+                                      Merge Join Operator [MERGEJOIN_209] (rows=47131396 width=11)
                                         Conds:RS_235._col0=RS_222._col0(Inner),Output:["_col1","_col2","_col3"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_222]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query18.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query18.q.out
index e919940..983d239 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query18.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query18.q.out
@@ -100,22 +100,22 @@ Stage-0
       File Output Operator [FS_176]
         Limit [LIM_175] (rows=100 width=1165)
           Number of rows:100
-          Select Operator [SEL_174] (rows=82276185 width=1165)
+          Select Operator [SEL_174] (rows=11124280 width=1165)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_173]
-              Select Operator [SEL_172] (rows=82276185 width=1165)
+              Select Operator [SEL_172] (rows=11124280 width=1165)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
-                Top N Key Operator [TNK_171] (rows=82276185 width=1229)
+                Top N Key Operator [TNK_171] (rows=11124280 width=1229)
                   keys:_col3, _col2, _col1, _col0,top n:100
-                  Group By Operator [GBY_170] (rows=82276185 width=1229)
+                  Group By Operator [GBY_170] (rows=11124280 width=1229)
                     Output:["_col0","_col1","_col2","_col3","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)","sum(VALUE._col2)","count(VALUE._col3)","sum(VALUE._col4)","count(VALUE._col5)","sum(VALUE._col6)","count(VALUE._col7)","sum(VALUE._col8)","count(VALUE._col9)","sum(VALUE._col10)","count(VALUE._col11)","sum(VALUE._col12)","count(VALUE._col13)"],keys:KEY._c [...]
                   <-Reducer 5 [SIMPLE_EDGE]
                     SHUFFLE [RS_40]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_39] (rows=82276185 width=1229)
+                      Group By Operator [GBY_39] (rows=11124280 width=1229)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18"],aggregations:["sum(_col12)","count(_col12)","sum(_col13)","count(_col13)","sum(_col14)","count(_col14)","sum(_col15)","count(_col15)","sum(_col16)","count(_col16)","sum(_col3)","count(_col3)","sum(_col19)","count(_col19)"],keys:_col21, _col5, _col6, _col7, 0L
-                        Merge Join Operator [MERGEJOIN_145] (rows=16455237 width=1117)
+                        Merge Join Operator [MERGEJOIN_145] (rows=2224856 width=816)
                           Conds:RS_35._col1=RS_169._col0(Inner),Output:["_col3","_col5","_col6","_col7","_col12","_col13","_col14","_col15","_col16","_col19","_col21"]
                         <-Map 16 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_169]
@@ -127,7 +127,7 @@ Stage-0
                         <-Reducer 4 [SIMPLE_EDGE]
                           SHUFFLE [RS_35]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_144] (rows=16225785 width=1120)
+                            Merge Join Operator [MERGEJOIN_144] (rows=2193833 width=813)
                               Conds:RS_32._col11=RS_167._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col12","_col13","_col14","_col15","_col16","_col19","_col21"]
                             <-Map 15 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_167]
@@ -139,12 +139,12 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE]
                               SHUFFLE [RS_32]
                                 PartitionCols:_col11
-                                Merge Join Operator [MERGEJOIN_143] (rows=16225785 width=1024)
+                                Merge Join Operator [MERGEJOIN_143] (rows=2193833 width=717)
                                   Conds:RS_29._col0=RS_30._col1(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col11","_col12","_col13","_col14","_col15","_col16","_col19"]
                                 <-Reducer 11 [SIMPLE_EDGE]
                                   SHUFFLE [RS_30]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_142] (rows=16225785 width=640)
+                                    Merge Join Operator [MERGEJOIN_142] (rows=15983636 width=639)
                                       Conds:RS_18._col2=RS_165._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col11"]
                                     <-Map 14 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_165]
@@ -158,7 +158,7 @@ Stage-0
                                     <-Reducer 10 [SIMPLE_EDGE]
                                       SHUFFLE [RS_18]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_141] (rows=283692098 width=569)
+                                        Merge Join Operator [MERGEJOIN_141] (rows=100578970 width=565)
                                           Conds:RS_162._col0=RS_154._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
                                         <-Map 12 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_154]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query19.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query19.q.out
index 4000b81..8b379d5 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query19.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query19.q.out
@@ -81,26 +81,26 @@ Stage-0
       File Output Operator [FS_150]
         Limit [LIM_149] (rows=100 width=419)
           Number of rows:100
-          Select Operator [SEL_148] (rows=76645658 width=418)
+          Select Operator [SEL_148] (rows=2098703 width=418)
             Output:["_col0","_col1","_col2","_col3","_col4"]
           <-Reducer 5 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_147]
-              Select Operator [SEL_146] (rows=76645658 width=418)
+              Select Operator [SEL_146] (rows=2098703 width=418)
                 Output:["_col2","_col3","_col4","_col5","_col6"]
-                Top N Key Operator [TNK_145] (rows=76645658 width=314)
+                Top N Key Operator [TNK_145] (rows=2098703 width=314)
                   keys:_col4, _col0, _col1, _col2, _col3,top n:100
-                  Group By Operator [GBY_144] (rows=76645658 width=314)
+                  Group By Operator [GBY_144] (rows=2098703 width=314)
                     Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
                   <-Reducer 4 [SIMPLE_EDGE]
                     SHUFFLE [RS_35]
                       PartitionCols:_col0, _col1, _col2, _col3
-                      Group By Operator [GBY_34] (rows=76645658 width=314)
+                      Group By Operator [GBY_34] (rows=2098703 width=314)
                         Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col8)"],keys:_col12, _col11, _col13, _col14
-                        Select Operator [SEL_33] (rows=76645658 width=458)
+                        Select Operator [SEL_33] (rows=2098703 width=378)
                           Output:["_col8","_col11","_col12","_col13","_col14"]
-                          Filter Operator [FIL_32] (rows=76645658 width=458)
+                          Filter Operator [FIL_32] (rows=2098703 width=378)
                             predicate:(_col3 <> _col16)
-                            Merge Join Operator [MERGEJOIN_122] (rows=76645658 width=458)
+                            Merge Join Operator [MERGEJOIN_122] (rows=2098703 width=378)
                               Conds:RS_29._col7=RS_143._col0(Inner),Output:["_col3","_col8","_col11","_col12","_col13","_col14","_col16"]
                             <-Map 14 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_143]
@@ -112,12 +112,12 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE]
                               SHUFFLE [RS_29]
                                 PartitionCols:_col7
-                                Merge Join Operator [MERGEJOIN_121] (rows=76645658 width=372)
+                                Merge Join Operator [MERGEJOIN_121] (rows=2098703 width=290)
                                   Conds:RS_26._col0=RS_27._col2(Inner),Output:["_col3","_col7","_col8","_col11","_col12","_col13","_col14"]
                                 <-Reducer 10 [SIMPLE_EDGE]
                                   SHUFFLE [RS_27]
                                     PartitionCols:_col2
-                                    Merge Join Operator [MERGEJOIN_120] (rows=76645658 width=287)
+                                    Merge Join Operator [MERGEJOIN_120] (rows=2098703 width=202)
                                       Conds:RS_17._col1=RS_141._col0(Inner),Output:["_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                     <-Map 13 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_141]
@@ -131,7 +131,7 @@ Stage-0
                                     <-Reducer 9 [SIMPLE_EDGE]
                                       SHUFFLE [RS_17]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_119] (rows=501694138 width=118)
+                                        Merge Join Operator [MERGEJOIN_119] (rows=13737330 width=4)
                                           Conds:RS_138._col0=RS_130._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                         <-Map 11 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_130]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query1b.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query1b.q.out
index a6d0d1a..0fb49d6 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query1b.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query1b.q.out
@@ -173,20 +173,20 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col2, _col3
                         input vertices:
                           1 Map 9
-                        Statistics: Num rows: 51757026 Data size: 5993457136 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 16855704 Data size: 1805298496 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: sum(_col3)
                           keys: _col2 (type: int), _col1 (type: int)
-                          minReductionHashAggr: 0.777413
+                          minReductionHashAggr: 0.8477136
                           mode: hash
                           outputColumnNames: _col0, _col1, _col2
-                          Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 16855704 Data size: 2008197920 Basic stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
                             key expressions: _col0 (type: int), _col1 (type: int)
                             null sort order: zz
                             sort order: ++
                             Map-reduce partition columns: _col0 (type: int), _col1 (type: int)
-                            Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 16855704 Data size: 2008197920 Basic stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: decimal(17,2))
                   Filter Operator
                     predicate: (sr_store_sk is not null and sr_returned_date_sk is not null and sr_store_sk BETWEEN DynamicValue(RS_40_store_s_store_sk_min) AND DynamicValue(RS_40_store_s_store_sk_max) and in_bloom_filter(sr_store_sk, DynamicValue(RS_40_store_s_store_sk_bloom_filter))) (type: boolean)
@@ -204,20 +204,20 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col2, _col3
                         input vertices:
                           1 Map 10
-                        Statistics: Num rows: 53634860 Data size: 6210910080 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 17467258 Data size: 1870797840 Basic stats: COMPLETE Column stats: COMPLETE
                         Group By Operator
                           aggregations: sum(_col3)
                           keys: _col2 (type: int), _col1 (type: int)
-                          minReductionHashAggr: 0.75666153
+                          minReductionHashAggr: 0.85304534
                           mode: hash
                           outputColumnNames: _col0, _col1, _col2
-                          Statistics: Num rows: 53634860 Data size: 6421171040 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 17467258 Data size: 2081058800 Basic stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
                             key expressions: _col0 (type: int), _col1 (type: int)
                             null sort order: zz
                             sort order: ++
                             Map-reduce partition columns: _col0 (type: int)
-                            Statistics: Num rows: 53634860 Data size: 6421171040 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 17467258 Data size: 2081058800 Basic stats: COMPLETE Column stats: COMPLETE
                             value expressions: _col2 (type: decimal(17,2))
             Execution mode: vectorized
         Map 9 
@@ -261,14 +261,14 @@ STAGE PLANS:
                 keys: KEY._col0 (type: int), KEY._col1 (type: int)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 14291868 Data size: 1702741080 Basic stats: COMPLETE Column stats: COMPLETE
                 Filter Operator
                   predicate: _col2 is not null (type: boolean)
-                  Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 14291868 Data size: 1702741080 Basic stats: COMPLETE Column stats: COMPLETE
                   Select Operator
                     expressions: _col1 (type: int), _col0 (type: int), _col2 (type: decimal(17,2))
                     outputColumnNames: _col0, _col1, _col2
-                    Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 14291868 Data size: 1702741080 Basic stats: COMPLETE Column stats: COMPLETE
                     Map Join Operator
                       condition map:
                            Inner Join 0 to 1
@@ -278,7 +278,7 @@ STAGE PLANS:
                       outputColumnNames: _col1, _col2, _col3
                       input vertices:
                         0 Map 1
-                      Statistics: Num rows: 51757026 Data size: 6196356560 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 2369298 Data size: 272032680 Basic stats: COMPLETE Column stats: COMPLETE
                       Map Join Operator
                         condition map:
                              Inner Join 0 to 1
@@ -288,22 +288,22 @@ STAGE PLANS:
                         outputColumnNames: _col1, _col3, _col4
                         input vertices:
                           1 Reducer 8
-                        Statistics: Num rows: 52373181 Data size: 11933836920 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 2448274 Data size: 552060636 Basic stats: COMPLETE Column stats: COMPLETE
                         Filter Operator
                           predicate: (_col3 > _col4) (type: boolean)
-                          Statistics: Num rows: 17457727 Data size: 3977945644 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 816091 Data size: 184020140 Basic stats: COMPLETE Column stats: COMPLETE
                           Reduce Output Operator
                             key expressions: _col1 (type: int)
                             null sort order: z
                             sort order: +
                             Map-reduce partition columns: _col1 (type: int)
-                            Statistics: Num rows: 17457727 Data size: 3977945644 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 816091 Data size: 184020140 Basic stats: COMPLETE Column stats: COMPLETE
                           Select Operator
                             expressions: _col1 (type: int)
                             outputColumnNames: _col0
-                            Statistics: Num rows: 17457727 Data size: 134829592 Basic stats: COMPLETE Column stats: COMPLETE
+                            Statistics: Num rows: 816091 Data size: 2431512 Basic stats: COMPLETE Column stats: COMPLETE
                             Group By Operator
-                              aggregations: min(_col0), max(_col0), bloom_filter(_col0, expectedEntries=1272219)
+                              aggregations: min(_col0), max(_col0), bloom_filter(_col0, expectedEntries=76429)
                               minReductionHashAggr: 0.99
                               mode: hash
                               outputColumnNames: _col0, _col1, _col2
@@ -322,22 +322,22 @@ STAGE PLANS:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col7
-                Statistics: Num rows: 17457727 Data size: 1745772700 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 816091 Data size: 81609100 Basic stats: COMPLETE Column stats: COMPLETE
                 Top N Key Operator
                   sort order: +
                   keys: _col7 (type: string)
                   null sort order: z
-                  Statistics: Num rows: 17457727 Data size: 1745772700 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 816091 Data size: 81609100 Basic stats: COMPLETE Column stats: COMPLETE
                   top n: 100
                   Select Operator
                     expressions: _col7 (type: string)
                     outputColumnNames: _col0
-                    Statistics: Num rows: 17457727 Data size: 1745772700 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 816091 Data size: 81609100 Basic stats: COMPLETE Column stats: COMPLETE
                     Reduce Output Operator
                       key expressions: _col0 (type: string)
                       null sort order: z
                       sort order: +
-                      Statistics: Num rows: 17457727 Data size: 1745772700 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 816091 Data size: 81609100 Basic stats: COMPLETE Column stats: COMPLETE
                       TopN Hash Memory Usage: 0.1
         Reducer 6 
             Execution mode: vectorized
@@ -345,7 +345,7 @@ STAGE PLANS:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 17457727 Data size: 1745772700 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 816091 Data size: 81609100 Basic stats: COMPLETE Column stats: COMPLETE
                 Limit
                   Number of rows: 100
                   Statistics: Num rows: 100 Data size: 10000 Basic stats: COMPLETE Column stats: COMPLETE
@@ -360,7 +360,7 @@ STAGE PLANS:
             Execution mode: vectorized
             Reduce Operator Tree:
               Group By Operator
-                aggregations: min(VALUE._col0), max(VALUE._col1), bloom_filter(VALUE._col2, expectedEntries=1272219)
+                aggregations: min(VALUE._col0), max(VALUE._col1), bloom_filter(VALUE._col2, expectedEntries=76429)
                 mode: final
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
@@ -377,30 +377,30 @@ STAGE PLANS:
                 keys: KEY._col0 (type: int), KEY._col1 (type: int)
                 mode: mergepartial
                 outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 53634860 Data size: 6421171040 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 14291868 Data size: 1702741076 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col0 (type: int), _col2 (type: decimal(17,2))
                   outputColumnNames: _col1, _col2
-                  Statistics: Num rows: 53634860 Data size: 6421171040 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 14291868 Data size: 1702741076 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     aggregations: sum(_col2), count(_col2)
                     keys: _col1 (type: int)
                     mode: complete
                     outputColumnNames: _col0, _col1, _col2
-                    Statistics: Num rows: 85 Data size: 10532 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 31 Data size: 3836 Basic stats: COMPLETE Column stats: COMPLETE
                     Filter Operator
                       predicate: CAST( (_col1 / _col2) AS decimal(21,6)) is not null (type: boolean)
-                      Statistics: Num rows: 85 Data size: 10532 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 31 Data size: 3836 Basic stats: COMPLETE Column stats: COMPLETE
                       Select Operator
                         expressions: (CAST( (_col1 / _col2) AS decimal(21,6)) * 1.2) (type: decimal(24,7)), _col0 (type: int)
                         outputColumnNames: _col0, _col1
-                        Statistics: Num rows: 85 Data size: 9852 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 31 Data size: 3588 Basic stats: COMPLETE Column stats: COMPLETE
                         Reduce Output Operator
                           key expressions: _col1 (type: int)
                           null sort order: z
                           sort order: +
                           Map-reduce partition columns: _col1 (type: int)
-                          Statistics: Num rows: 85 Data size: 9852 Basic stats: COMPLETE Column stats: COMPLETE
+                          Statistics: Num rows: 31 Data size: 3588 Basic stats: COMPLETE Column stats: COMPLETE
                           value expressions: _col0 (type: decimal(24,7))
 
   Stage: Stage-0
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query20.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query20.q.out
index dc3b77f..601efc0 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query20.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query20.q.out
@@ -87,23 +87,23 @@ Stage-0
             SHUFFLE [RS_80]
               Select Operator [SEL_79] (rows=138600 width=801)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                Top N Key Operator [TNK_78] (rows=138600 width=690)
+                Top N Key Operator [TNK_78] (rows=138600 width=689)
                   keys:_col0, _col1, _col2, _col3, ((_col5 * 100) / sum_window_0),top n:100
-                  PTF Operator [PTF_77] (rows=138600 width=690)
+                  PTF Operator [PTF_77] (rows=138600 width=689)
                     Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col1"}]
-                    Select Operator [SEL_76] (rows=138600 width=690)
+                    Select Operator [SEL_76] (rows=138600 width=689)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                     <-Reducer 4 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_75]
                         PartitionCols:_col1
-                        Group By Operator [GBY_74] (rows=138600 width=690)
+                        Group By Operator [GBY_74] (rows=138600 width=689)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_17]
                             PartitionCols:_col0, _col1, _col2, _col3, _col4
-                            Group By Operator [GBY_16] (rows=138600 width=690)
+                            Group By Operator [GBY_16] (rows=138600 width=689)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)"],keys:_col9, _col8, _col5, _col6, _col7
-                              Merge Join Operator [MERGEJOIN_59] (rows=85964922 width=688)
+                              Merge Join Operator [MERGEJOIN_59] (rows=9551005 width=673)
                                 Conds:RS_12._col1=RS_73._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9"]
                               <-Map 9 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_73]
@@ -117,7 +117,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_12]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_58] (rows=286549727 width=115)
+                                  Merge Join Operator [MERGEJOIN_58] (rows=31836679 width=110)
                                     Conds:RS_70._col0=RS_62._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 7 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_62]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query23.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query23.q.out
index aced542..13d1a99 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query23.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query23.q.out
@@ -1,4 +1,5 @@
-Warning: Shuffle Join MERGEJOIN[358][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 15' is a cross product
+Warning: Shuffle Join MERGEJOIN[358][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 17' is a cross product
+Warning: Shuffle Join MERGEJOIN[360][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 23' is a cross product
 PREHOOK: query: explain
 with frequent_ss_items as 
  (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
@@ -118,275 +119,272 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Reducer 8 (BROADCAST_EDGE)
-Map 17 <- Reducer 22 (BROADCAST_EDGE)
-Map 23 <- Reducer 29 (BROADCAST_EDGE)
-Map 31 <- Reducer 12 (BROADCAST_EDGE)
-Reducer 10 <- Reducer 16 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Reducer 27 (SIMPLE_EDGE), Union 5 (CONTAINS)
-Reducer 12 <- Map 7 (CUSTOM_SIMPLE_EDGE)
-Reducer 14 <- Map 13 (SIMPLE_EDGE)
-Reducer 15 <- Reducer 14 (CUSTOM_SIMPLE_EDGE), Reducer 20 (CUSTOM_SIMPLE_EDGE)
-Reducer 16 <- Reducer 15 (SIMPLE_EDGE)
-Reducer 18 <- Map 17 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
-Reducer 19 <- Reducer 18 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
-Reducer 20 <- Reducer 19 (CUSTOM_SIMPLE_EDGE)
-Reducer 22 <- Map 21 (CUSTOM_SIMPLE_EDGE)
-Reducer 24 <- Map 23 (SIMPLE_EDGE), Map 28 (SIMPLE_EDGE)
-Reducer 25 <- Map 30 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
-Reducer 26 <- Reducer 25 (SIMPLE_EDGE)
-Reducer 27 <- Reducer 25 (SIMPLE_EDGE)
-Reducer 29 <- Map 28 (CUSTOM_SIMPLE_EDGE)
-Reducer 3 <- Reducer 16 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 26 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE), Union 5 (CONTAINS)
+Map 1 <- Reducer 9 (BROADCAST_EDGE)
+Map 15 <- Reducer 7 (BROADCAST_EDGE)
+Map 19 <- Reducer 26 (BROADCAST_EDGE)
+Map 27 <- Reducer 33 (BROADCAST_EDGE)
+Map 35 <- Reducer 14 (BROADCAST_EDGE)
+Map 36 <- Reducer 13 (BROADCAST_EDGE)
+Reducer 10 <- Map 35 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
+Reducer 12 <- Reducer 11 (SIMPLE_EDGE), Reducer 31 (SIMPLE_EDGE), Union 5 (CONTAINS)
+Reducer 13 <- Reducer 10 (CUSTOM_SIMPLE_EDGE)
+Reducer 14 <- Map 8 (CUSTOM_SIMPLE_EDGE)
+Reducer 16 <- Map 15 (SIMPLE_EDGE)
+Reducer 17 <- Reducer 16 (CUSTOM_SIMPLE_EDGE), Reducer 22 (CUSTOM_SIMPLE_EDGE)
+Reducer 18 <- Reducer 17 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 20 <- Map 19 (SIMPLE_EDGE), Map 25 (SIMPLE_EDGE)
+Reducer 21 <- Reducer 20 (SIMPLE_EDGE)
+Reducer 22 <- Reducer 21 (CUSTOM_SIMPLE_EDGE)
+Reducer 23 <- Reducer 22 (CUSTOM_SIMPLE_EDGE), Reducer 37 (CUSTOM_SIMPLE_EDGE)
+Reducer 24 <- Reducer 23 (SIMPLE_EDGE)
+Reducer 26 <- Map 25 (CUSTOM_SIMPLE_EDGE)
+Reducer 28 <- Map 27 (SIMPLE_EDGE), Map 32 (SIMPLE_EDGE)
+Reducer 29 <- Map 34 (SIMPLE_EDGE), Reducer 28 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 18 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 30 <- Reducer 29 (SIMPLE_EDGE)
+Reducer 31 <- Reducer 29 (SIMPLE_EDGE)
+Reducer 33 <- Map 32 (CUSTOM_SIMPLE_EDGE)
+Reducer 37 <- Map 36 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE), Reducer 30 (SIMPLE_EDGE), Union 5 (CONTAINS)
 Reducer 6 <- Union 5 (CUSTOM_SIMPLE_EDGE)
-Reducer 8 <- Map 7 (CUSTOM_SIMPLE_EDGE)
-Reducer 9 <- Map 31 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Map 8 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 6 vectorized
-      File Output Operator [FS_438]
-        Group By Operator [GBY_437] (rows=1 width=112)
+      File Output Operator [FS_440]
+        Group By Operator [GBY_439] (rows=1 width=112)
           Output:["_col0"],aggregations:["sum(VALUE._col0)"]
         <-Union 5 [CUSTOM_SIMPLE_EDGE]
-          <-Reducer 11 [CONTAINS]
+          <-Reducer 12 [CONTAINS]
             Reduce Output Operator [RS_373]
               Group By Operator [GBY_372] (rows=1 width=112)
                 Output:["_col0"],aggregations:["sum(_col0)"]
-                Select Operator [SEL_370] (rows=22920586 width=112)
+                Select Operator [SEL_370] (rows=3941102 width=112)
                   Output:["_col0"]
-                  Merge Join Operator [MERGEJOIN_369] (rows=22920586 width=115)
-                    Conds:RS_152._col1=RS_449._col0(Left Semi),Output:["_col3","_col4"]
-                  <-Reducer 10 [SIMPLE_EDGE]
+                  Merge Join Operator [MERGEJOIN_369] (rows=3941102 width=114)
+                    Conds:RS_152._col1=RS_462._col0(Left Semi),Output:["_col3","_col4"]
+                  <-Reducer 11 [SIMPLE_EDGE]
                     SHUFFLE [RS_152]
                       PartitionCols:_col1
-                      Merge Join Operator [MERGEJOIN_361] (rows=22920586 width=119)
-                        Conds:RS_147._col2=RS_417._col0(Inner),Output:["_col1","_col3","_col4"]
-                      <-Reducer 16 [SIMPLE_EDGE] vectorized
-                        SHUFFLE [RS_417]
+                      Merge Join Operator [MERGEJOIN_361] (rows=3941102 width=118)
+                        Conds:RS_147._col2=RS_456._col0(Inner),Output:["_col1","_col3","_col4"]
+                      <-Reducer 10 [SIMPLE_EDGE]
+                        PARTITION_ONLY_SHUFFLE [RS_147]
+                          PartitionCols:_col2
+                          Merge Join Operator [MERGEJOIN_354] (rows=3941102 width=122)
+                            Conds:RS_445._col0=RS_378._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                          <-Map 8 [SIMPLE_EDGE] vectorized
+                            PARTITION_ONLY_SHUFFLE [RS_378]
+                              PartitionCols:_col0
+                              Select Operator [SEL_375] (rows=50 width=4)
+                                Output:["_col0"]
+                                Filter Operator [FIL_374] (rows=50 width=12)
+                                  predicate:((d_year = 1999) and (d_moy = 1))
+                                  TableScan [TS_3] (rows=73049 width=12)
+                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                          <-Map 35 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_445]
+                              PartitionCols:_col0
+                              Select Operator [SEL_444] (rows=143930993 width=127)
+                                Output:["_col0","_col1","_col2","_col3","_col4"]
+                                Filter Operator [FIL_443] (rows=143930993 width=127)
+                                  predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_sold_date_sk BETWEEN DynamicValue(RS_145_date_dim_d_date_sk_min) AND DynamicValue(RS_145_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_145_date_dim_d_date_sk_bloom_filter)))
+                                  TableScan [TS_78] (rows=144002668 width=127)
+                                    default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_item_sk","ws_bill_customer_sk","ws_quantity","ws_list_price"]
+                                  <-Reducer 14 [BROADCAST_EDGE] vectorized
+                                    BROADCAST [RS_442]
+                                      Group By Operator [GBY_441] (rows=1 width=12)
+                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                      <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_383]
+                                          Group By Operator [GBY_381] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                            Select Operator [SEL_379] (rows=50 width=4)
+                                              Output:["_col0"]
+                                               Please refer to the previous Select Operator [SEL_375]
+                      <-Reducer 24 [SIMPLE_EDGE] vectorized
+                        SHUFFLE [RS_456]
                           PartitionCols:_col0
-                          Group By Operator [GBY_415] (rows=225322 width=3)
+                          Group By Operator [GBY_455] (rows=235937 width=3)
                             Output:["_col0"],keys:KEY._col0
-                          <-Reducer 15 [SIMPLE_EDGE]
-                            SHUFFLE [RS_42]
+                          <-Reducer 23 [SIMPLE_EDGE]
+                            SHUFFLE [RS_120]
                               PartitionCols:_col0
-                              Group By Operator [GBY_41] (rows=225322 width=3)
+                              Group By Operator [GBY_119] (rows=235937 width=3)
                                 Output:["_col0"],keys:_col0
-                                Select Operator [SEL_40] (rows=450644 width=227)
+                                Select Operator [SEL_118] (rows=471875 width=227)
                                   Output:["_col0"]
-                                  Filter Operator [FIL_39] (rows=450644 width=227)
+                                  Filter Operator [FIL_117] (rows=471875 width=227)
                                     predicate:(_col1 > _col2)
-                                    Merge Join Operator [MERGEJOIN_358] (rows=1351934 width=227)
+                                    Merge Join Operator [MERGEJOIN_360] (rows=1415626 width=227)
                                       Conds:(Inner),Output:["_col0","_col1","_col2"]
-                                    <-Reducer 14 [CUSTOM_SIMPLE_EDGE] vectorized
-                                      PARTITION_ONLY_SHUFFLE [RS_395]
-                                        Filter Operator [FIL_394] (rows=1351934 width=115)
-                                          predicate:_col1 is not null
-                                          Group By Operator [GBY_393] (rows=1351934 width=115)
-                                            Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
-                                          <-Map 13 [SIMPLE_EDGE] vectorized
-                                            SHUFFLE [RS_392]
-                                              PartitionCols:_col0
-                                              Group By Operator [GBY_391] (rows=550080312 width=115)
-                                                Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
-                                                Select Operator [SEL_390] (rows=550080312 width=114)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_389] (rows=550080312 width=114)
-                                                    predicate:ss_customer_sk is not null
-                                                    TableScan [TS_6] (rows=575995635 width=114)
-                                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_customer_sk","ss_quantity","ss_sales_price"]
-                                    <-Reducer 20 [CUSTOM_SIMPLE_EDGE] vectorized
-                                      PARTITION_ONLY_SHUFFLE [RS_414]
-                                        Select Operator [SEL_413] (rows=1 width=112)
+                                    <-Reducer 22 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_417]
+                                        Select Operator [SEL_415] (rows=1 width=112)
                                           Output:["_col0"]
-                                          Filter Operator [FIL_412] (rows=1 width=112)
+                                          Filter Operator [FIL_414] (rows=1 width=112)
                                             predicate:_col0 is not null
-                                            Group By Operator [GBY_411] (rows=1 width=112)
+                                            Group By Operator [GBY_413] (rows=1 width=112)
                                               Output:["_col0"],aggregations:["max(VALUE._col0)"]
-                                            <-Reducer 19 [CUSTOM_SIMPLE_EDGE] vectorized
-                                              PARTITION_ONLY_SHUFFLE [RS_410]
-                                                Group By Operator [GBY_409] (rows=1 width=112)
+                                            <-Reducer 21 [CUSTOM_SIMPLE_EDGE] vectorized
+                                              PARTITION_ONLY_SHUFFLE [RS_412]
+                                                Group By Operator [GBY_411] (rows=1 width=112)
                                                   Output:["_col0"],aggregations:["max(_col1)"]
-                                                  Select Operator [SEL_408] (rows=1291099 width=115)
+                                                  Select Operator [SEL_410] (rows=50562 width=112)
                                                     Output:["_col1"]
-                                                    Group By Operator [GBY_407] (rows=1291099 width=115)
+                                                    Group By Operator [GBY_409] (rows=50562 width=112)
                                                       Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
-                                                    <-Reducer 18 [SIMPLE_EDGE]
+                                                    <-Reducer 20 [SIMPLE_EDGE]
                                                       SHUFFLE [RS_26]
                                                         PartitionCols:_col0
-                                                        Group By Operator [GBY_25] (rows=525327388 width=115)
+                                                        Group By Operator [GBY_25] (rows=455058 width=112)
                                                           Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col1
-                                                          Merge Join Operator [MERGEJOIN_351] (rows=525327388 width=115)
-                                                            Conds:RS_406._col0=RS_398._col0(Inner),Output:["_col1","_col2"]
-                                                          <-Map 21 [SIMPLE_EDGE] vectorized
-                                                            PARTITION_ONLY_SHUFFLE [RS_398]
+                                                          Merge Join Operator [MERGEJOIN_351] (rows=18762463 width=112)
+                                                            Conds:RS_408._col0=RS_400._col0(Inner),Output:["_col1","_col2"]
+                                                          <-Map 25 [SIMPLE_EDGE] vectorized
+                                                            PARTITION_ONLY_SHUFFLE [RS_400]
                                                               PartitionCols:_col0
-                                                              Select Operator [SEL_397] (rows=2609 width=4)
+                                                              Select Operator [SEL_399] (rows=2609 width=4)
                                                                 Output:["_col0"]
-                                                                Filter Operator [FIL_396] (rows=2609 width=8)
+                                                                Filter Operator [FIL_398] (rows=2609 width=8)
                                                                   predicate:(d_year) IN (1999, 2000, 2001, 2002)
                                                                   TableScan [TS_18] (rows=73049 width=8)
                                                                     default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year"]
-                                                          <-Map 17 [SIMPLE_EDGE] vectorized
-                                                            SHUFFLE [RS_406]
+                                                          <-Map 19 [SIMPLE_EDGE] vectorized
+                                                            SHUFFLE [RS_408]
                                                               PartitionCols:_col0
-                                                              Select Operator [SEL_405] (rows=525327388 width=119)
+                                                              Select Operator [SEL_407] (rows=525327388 width=119)
                                                                 Output:["_col0","_col1","_col2"]
-                                                                Filter Operator [FIL_404] (rows=525327388 width=118)
+                                                                Filter Operator [FIL_406] (rows=525327388 width=118)
                                                                   predicate:(ss_sold_date_sk is not null and ss_customer_sk is not null and ss_sold_date_sk BETWEEN DynamicValue(RS_22_date_dim_d_date_sk_min) AND DynamicValue(RS_22_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_22_date_dim_d_date_sk_bloom_filter)))
                                                                   TableScan [TS_15] (rows=575995635 width=118)
                                                                     default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk","ss_quantity","ss_sales_price"]
-                                                                  <-Reducer 22 [BROADCAST_EDGE] vectorized
-                                                                    BROADCAST [RS_403]
-                                                                      Group By Operator [GBY_402] (rows=1 width=12)
+                                                                  <-Reducer 26 [BROADCAST_EDGE] vectorized
+                                                                    BROADCAST [RS_405]
+                                                                      Group By Operator [GBY_404] (rows=1 width=12)
                                                                         Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                                      <-Map 21 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                                        PARTITION_ONLY_SHUFFLE [RS_401]
-                                                                          Group By Operator [GBY_400] (rows=1 width=12)
+                                                                      <-Map 25 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                                        PARTITION_ONLY_SHUFFLE [RS_403]
+                                                                          Group By Operator [GBY_402] (rows=1 width=12)
                                                                             Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                                            Select Operator [SEL_399] (rows=2609 width=4)
+                                                                            Select Operator [SEL_401] (rows=2609 width=4)
                                                                               Output:["_col0"]
-                                                                               Please refer to the previous Select Operator [SEL_397]
-                      <-Reducer 9 [SIMPLE_EDGE]
-                        SHUFFLE [RS_147]
-                          PartitionCols:_col2
-                          Merge Join Operator [MERGEJOIN_354] (rows=143930993 width=123)
-                            Conds:RS_443._col0=RS_378._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                          <-Map 7 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_378]
-                              PartitionCols:_col0
-                              Select Operator [SEL_375] (rows=50 width=4)
-                                Output:["_col0"]
-                                Filter Operator [FIL_374] (rows=50 width=12)
-                                  predicate:((d_year = 1999) and (d_moy = 1))
-                                  TableScan [TS_3] (rows=73049 width=12)
-                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
-                          <-Map 31 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_443]
-                              PartitionCols:_col0
-                              Select Operator [SEL_442] (rows=143930993 width=127)
-                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                Filter Operator [FIL_441] (rows=143930993 width=127)
-                                  predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_sold_date_sk BETWEEN DynamicValue(RS_145_date_dim_d_date_sk_min) AND DynamicValue(RS_145_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_145_date_dim_d_date_sk_bloom_filter)))
-                                  TableScan [TS_78] (rows=144002668 width=127)
-                                    default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_item_sk","ws_bill_customer_sk","ws_quantity","ws_list_price"]
-                                  <-Reducer 12 [BROADCAST_EDGE] vectorized
-                                    BROADCAST [RS_440]
-                                      Group By Operator [GBY_439] (rows=1 width=12)
-                                        Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                      <-Map 7 [CUSTOM_SIMPLE_EDGE] vectorized
-                                        SHUFFLE [RS_383]
-                                          Group By Operator [GBY_381] (rows=1 width=12)
-                                            Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                            Select Operator [SEL_379] (rows=50 width=4)
-                                              Output:["_col0"]
-                                               Please refer to the previous Select Operator [SEL_375]
-                  <-Reducer 27 [SIMPLE_EDGE] vectorized
-                    SHUFFLE [RS_449]
+                                                                               Please refer to the previous Select Operator [SEL_399]
+                                    <-Reducer 37 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_454]
+                                        Filter Operator [FIL_453] (rows=1415626 width=115)
+                                          predicate:_col1 is not null
+                                          Group By Operator [GBY_452] (rows=1415626 width=115)
+                                            Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
+                                          <-Map 36 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_451]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_450] (rows=550080312 width=115)
+                                                Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
+                                                Select Operator [SEL_449] (rows=550080312 width=114)
+                                                  Output:["_col0","_col1"]
+                                                  Filter Operator [FIL_448] (rows=550080312 width=114)
+                                                    predicate:(ss_customer_sk is not null and ss_customer_sk BETWEEN DynamicValue(RS_147_web_sales_ws_bill_customer_sk_min) AND DynamicValue(RS_147_web_sales_ws_bill_customer_sk_max) and in_bloom_filter(ss_customer_sk, DynamicValue(RS_147_web_sales_ws_bill_customer_sk_bloom_filter)))
+                                                    TableScan [TS_84] (rows=575995635 width=114)
+                                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_customer_sk","ss_quantity","ss_sales_price"]
+                                                    <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                                      BROADCAST [RS_447]
+                                                        Group By Operator [GBY_446] (rows=1 width=12)
+                                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                        <-Reducer 10 [CUSTOM_SIMPLE_EDGE]
+                                                          PARTITION_ONLY_SHUFFLE [RS_319]
+                                                            Group By Operator [GBY_318] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                              Select Operator [SEL_317] (rows=3941102 width=7)
+                                                                Output:["_col0"]
+                                                                 Please refer to the previous Merge Join Operator [MERGEJOIN_354]
+                  <-Reducer 31 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_462]
                       PartitionCols:_col0
-                      Group By Operator [GBY_448] (rows=62562 width=4)
+                      Group By Operator [GBY_461] (rows=2235 width=4)
                         Output:["_col0"],keys:_col0
-                        Select Operator [SEL_447] (rows=54408086 width=4)
+                        Select Operator [SEL_460] (rows=1943705 width=4)
                           Output:["_col0"]
-                          Filter Operator [FIL_446] (rows=54408086 width=106)
+                          Filter Operator [FIL_459] (rows=1943705 width=106)
                             predicate:(_col2 > 4L)
-                            Select Operator [SEL_445] (rows=163224258 width=106)
+                            Select Operator [SEL_458] (rows=5831115 width=106)
                               Output:["_col0","_col2"]
-                              Group By Operator [GBY_444] (rows=163224258 width=106)
+                              Group By Operator [GBY_457] (rows=5831115 width=106)
                                 Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                              <-Reducer 25 [SIMPLE_EDGE]
+                              <-Reducer 29 [SIMPLE_EDGE]
                                 SHUFFLE [RS_139]
                                   PartitionCols:_col0, _col1
-                                  Group By Operator [GBY_60] (rows=550076554 width=106)
+                                  Group By Operator [GBY_60] (rows=19646398 width=106)
                                     Output:["_col0","_col1","_col2"],aggregations:["count()"],keys:_col4, _col3
-                                    Merge Join Operator [MERGEJOIN_353] (rows=550076554 width=98)
-                                      Conds:RS_56._col1=RS_430._col0(Inner),Output:["_col3","_col4"]
-                                    <-Map 30 [SIMPLE_EDGE] vectorized
-                                      SHUFFLE [RS_430]
+                                    Merge Join Operator [MERGEJOIN_353] (rows=19646398 width=98)
+                                      Conds:RS_56._col1=RS_432._col0(Inner),Output:["_col3","_col4"]
+                                    <-Map 34 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_432]
                                         PartitionCols:_col0
-                                        Select Operator [SEL_429] (rows=462000 width=188)
+                                        Select Operator [SEL_431] (rows=462000 width=188)
                                           Output:["_col0"]
                                           TableScan [TS_51] (rows=462000 width=4)
                                             default@item,item,Tbl:COMPLETE,Col:COMPLETE,Output:["i_item_sk"]
-                                    <-Reducer 24 [SIMPLE_EDGE]
+                                    <-Reducer 28 [SIMPLE_EDGE]
                                       SHUFFLE [RS_56]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_352] (rows=550076554 width=98)
-                                          Conds:RS_428._col0=RS_420._col0(Inner),Output:["_col1","_col3"]
-                                        <-Map 28 [SIMPLE_EDGE] vectorized
-                                          PARTITION_ONLY_SHUFFLE [RS_420]
+                                        Merge Join Operator [MERGEJOIN_352] (rows=19646398 width=98)
+                                          Conds:RS_430._col0=RS_422._col0(Inner),Output:["_col1","_col3"]
+                                        <-Map 32 [SIMPLE_EDGE] vectorized
+                                          PARTITION_ONLY_SHUFFLE [RS_422]
                                             PartitionCols:_col0
-                                            Select Operator [SEL_419] (rows=2609 width=98)
+                                            Select Operator [SEL_421] (rows=2609 width=98)
                                               Output:["_col0","_col1"]
-                                              Filter Operator [FIL_418] (rows=2609 width=102)
+                                              Filter Operator [FIL_420] (rows=2609 width=102)
                                                 predicate:(d_year) IN (1999, 2000, 2001, 2002)
                                                 TableScan [TS_48] (rows=73049 width=102)
                                                   default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_date","d_year"]
-                                        <-Map 23 [SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_428]
+                                        <-Map 27 [SIMPLE_EDGE] vectorized
+                                          SHUFFLE [RS_430]
                                             PartitionCols:_col0
-                                            Select Operator [SEL_427] (rows=550076554 width=7)
+                                            Select Operator [SEL_429] (rows=550076554 width=7)
                                               Output:["_col0","_col1"]
-                                              Filter Operator [FIL_426] (rows=550076554 width=7)
+                                              Filter Operator [FIL_428] (rows=550076554 width=7)
                                                 predicate:(ss_sold_date_sk is not null and ss_sold_date_sk BETWEEN DynamicValue(RS_54_date_dim_d_date_sk_min) AND DynamicValue(RS_54_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_54_date_dim_d_date_sk_bloom_filter)))
                                                 TableScan [TS_45] (rows=575995635 width=7)
                                                   default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk"]
-                                                <-Reducer 29 [BROADCAST_EDGE] vectorized
-                                                  BROADCAST [RS_425]
-                                                    Group By Operator [GBY_424] (rows=1 width=12)
+                                                <-Reducer 33 [BROADCAST_EDGE] vectorized
+                                                  BROADCAST [RS_427]
+                                                    Group By Operator [GBY_426] (rows=1 width=12)
                                                       Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                    <-Map 28 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                      PARTITION_ONLY_SHUFFLE [RS_423]
-                                                        Group By Operator [GBY_422] (rows=1 width=12)
+                                                    <-Map 32 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                      PARTITION_ONLY_SHUFFLE [RS_425]
+                                                        Group By Operator [GBY_424] (rows=1 width=12)
                                                           Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                          Select Operator [SEL_421] (rows=2609 width=4)
+                                                          Select Operator [SEL_423] (rows=2609 width=4)
                                                             Output:["_col0"]
-                                                             Please refer to the previous Select Operator [SEL_419]
+                                                             Please refer to the previous Select Operator [SEL_421]
           <-Reducer 4 [CONTAINS]
             Reduce Output Operator [RS_368]
               Group By Operator [GBY_367] (rows=1 width=112)
                 Output:["_col0"],aggregations:["sum(_col0)"]
-                Select Operator [SEL_365] (rows=45838710 width=112)
+                Select Operator [SEL_365] (rows=7751875 width=112)
                   Output:["_col0"]
-                  Merge Join Operator [MERGEJOIN_364] (rows=45838710 width=112)
-                    Conds:RS_74._col2=RS_436._col0(Left Semi),Output:["_col3","_col4"]
-                  <-Reducer 26 [SIMPLE_EDGE] vectorized
-                    SHUFFLE [RS_436]
-                      PartitionCols:_col0
-                      Group By Operator [GBY_435] (rows=62562 width=4)
-                        Output:["_col0"],keys:_col0
-                        Select Operator [SEL_434] (rows=54408086 width=4)
-                          Output:["_col0"]
-                          Filter Operator [FIL_433] (rows=54408086 width=106)
-                            predicate:(_col2 > 4L)
-                            Select Operator [SEL_432] (rows=163224258 width=106)
-                              Output:["_col0","_col2"]
-                              Group By Operator [GBY_431] (rows=163224258 width=106)
-                                Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                              <-Reducer 25 [SIMPLE_EDGE]
-                                SHUFFLE [RS_61]
-                                  PartitionCols:_col0, _col1
-                                   Please refer to the previous Group By Operator [GBY_60]
+                  Merge Join Operator [MERGEJOIN_364] (rows=7751875 width=94)
+                    Conds:RS_74._col2=RS_438._col0(Left Semi),Output:["_col3","_col4"]
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_74]
                       PartitionCols:_col2
-                      Merge Join Operator [MERGEJOIN_359] (rows=45838710 width=116)
-                        Conds:RS_69._col1=RS_416._col0(Inner),Output:["_col2","_col3","_col4"]
-                      <-Reducer 16 [SIMPLE_EDGE] vectorized
-                        SHUFFLE [RS_416]
-                          PartitionCols:_col0
-                           Please refer to the previous Group By Operator [GBY_415]
+                      Merge Join Operator [MERGEJOIN_359] (rows=7751875 width=98)
+                        Conds:RS_69._col1=RS_419._col0(Inner),Output:["_col2","_col3","_col4"]
                       <-Reducer 2 [SIMPLE_EDGE]
-                        SHUFFLE [RS_69]
+                        PARTITION_ONLY_SHUFFLE [RS_69]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_350] (rows=285117831 width=123)
+                          Merge Join Operator [MERGEJOIN_350] (rows=7751875 width=101)
                             Conds:RS_388._col0=RS_376._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                          <-Map 7 [SIMPLE_EDGE] vectorized
-                            SHUFFLE [RS_376]
+                          <-Map 8 [SIMPLE_EDGE] vectorized
+                            PARTITION_ONLY_SHUFFLE [RS_376]
                               PartitionCols:_col0
                                Please refer to the previous Select Operator [SEL_375]
                           <-Map 1 [SIMPLE_EDGE] vectorized
@@ -398,15 +396,79 @@ Stage-0
                                   predicate:(cs_sold_date_sk is not null and cs_bill_customer_sk is not null and cs_sold_date_sk BETWEEN DynamicValue(RS_67_date_dim_d_date_sk_min) AND DynamicValue(RS_67_date_dim_d_date_sk_max) and in_bloom_filter(cs_sold_date_sk, DynamicValue(RS_67_date_dim_d_date_sk_bloom_filter)))
                                   TableScan [TS_0] (rows=287989836 width=127)
                                     default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_item_sk","cs_quantity","cs_list_price"]
-                                  <-Reducer 8 [BROADCAST_EDGE] vectorized
+                                  <-Reducer 9 [BROADCAST_EDGE] vectorized
                                     BROADCAST [RS_385]
                                       Group By Operator [GBY_384] (rows=1 width=12)
                                         Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                      <-Map 7 [CUSTOM_SIMPLE_EDGE] vectorized
-                                        SHUFFLE [RS_382]
+                                      <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_382]
                                           Group By Operator [GBY_380] (rows=1 width=12)
                                             Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
                                             Select Operator [SEL_377] (rows=50 width=4)
                                               Output:["_col0"]
                                                Please refer to the previous Select Operator [SEL_375]
+                      <-Reducer 18 [SIMPLE_EDGE] vectorized
+                        SHUFFLE [RS_419]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_418] (rows=235937 width=3)
+                            Output:["_col0"],keys:KEY._col0
+                          <-Reducer 17 [SIMPLE_EDGE]
+                            SHUFFLE [RS_42]
+                              PartitionCols:_col0
+                              Group By Operator [GBY_41] (rows=235937 width=3)
+                                Output:["_col0"],keys:_col0
+                                Select Operator [SEL_40] (rows=471875 width=227)
+                                  Output:["_col0"]
+                                  Filter Operator [FIL_39] (rows=471875 width=227)
+                                    predicate:(_col1 > _col2)
+                                    Merge Join Operator [MERGEJOIN_358] (rows=1415626 width=227)
+                                      Conds:(Inner),Output:["_col0","_col1","_col2"]
+                                    <-Reducer 22 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_416]
+                                         Please refer to the previous Select Operator [SEL_415]
+                                    <-Reducer 16 [CUSTOM_SIMPLE_EDGE] vectorized
+                                      PARTITION_ONLY_SHUFFLE [RS_397]
+                                        Filter Operator [FIL_396] (rows=1415626 width=115)
+                                          predicate:_col1 is not null
+                                          Group By Operator [GBY_395] (rows=1415626 width=115)
+                                            Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
+                                          <-Map 15 [SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_394]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_393] (rows=550080312 width=115)
+                                                Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
+                                                Select Operator [SEL_392] (rows=550080312 width=114)
+                                                  Output:["_col0","_col1"]
+                                                  Filter Operator [FIL_391] (rows=550080312 width=114)
+                                                    predicate:(ss_customer_sk is not null and ss_customer_sk BETWEEN DynamicValue(RS_69_catalog_sales_cs_bill_customer_sk_min) AND DynamicValue(RS_69_catalog_sales_cs_bill_customer_sk_max) and in_bloom_filter(ss_customer_sk, DynamicValue(RS_69_catalog_sales_cs_bill_customer_sk_bloom_filter)))
+                                                    TableScan [TS_6] (rows=575995635 width=114)
+                                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_customer_sk","ss_quantity","ss_sales_price"]
+                                                    <-Reducer 7 [BROADCAST_EDGE] vectorized
+                                                      BROADCAST [RS_390]
+                                                        Group By Operator [GBY_389] (rows=1 width=12)
+                                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                        <-Reducer 2 [CUSTOM_SIMPLE_EDGE]
+                                                          PARTITION_ONLY_SHUFFLE [RS_256]
+                                                            Group By Operator [GBY_255] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                              Select Operator [SEL_254] (rows=7751875 width=6)
+                                                                Output:["_col0"]
+                                                                 Please refer to the previous Merge Join Operator [MERGEJOIN_350]
+                  <-Reducer 30 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_438]
+                      PartitionCols:_col0
+                      Group By Operator [GBY_437] (rows=2235 width=4)
+                        Output:["_col0"],keys:_col0
+                        Select Operator [SEL_436] (rows=1943705 width=4)
+                          Output:["_col0"]
+                          Filter Operator [FIL_435] (rows=1943705 width=106)
+                            predicate:(_col2 > 4L)
+                            Select Operator [SEL_434] (rows=5831115 width=106)
+                              Output:["_col0","_col2"]
+                              Group By Operator [GBY_433] (rows=5831115 width=106)
+                                Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
+                              <-Reducer 29 [SIMPLE_EDGE]
+                                SHUFFLE [RS_61]
+                                  PartitionCols:_col0, _col1
+                                   Please refer to the previous Group By Operator [GBY_60]
 
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query25.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query25.q.out
index 144c5d2..22c03eb 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query25.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query25.q.out
@@ -131,20 +131,20 @@ Stage-0
       File Output Operator [FS_251]
         Limit [LIM_250] (rows=100 width=808)
           Number of rows:100
-          Select Operator [SEL_249] (rows=97302218301 width=808)
+          Select Operator [SEL_249] (rows=4248052730 width=808)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_248]
-              Group By Operator [GBY_247] (rows=97302218301 width=808)
+              Group By Operator [GBY_247] (rows=4248052730 width=808)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
               <-Reducer 5 [SIMPLE_EDGE]
                 SHUFFLE [RS_47]
                   PartitionCols:_col0, _col1, _col2, _col3
-                  Group By Operator [GBY_46] (rows=97302218301 width=808)
+                  Group By Operator [GBY_46] (rows=4248052730 width=808)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col10)","sum(_col16)","sum(_col3)"],keys:_col22, _col23, _col19, _col20
-                    Top N Key Operator [TNK_96] (rows=97302218301 width=807)
+                    Top N Key Operator [TNK_96] (rows=4248052730 width=807)
                       keys:_col22, _col23, _col19, _col20,top n:100
-                      Merge Join Operator [MERGEJOIN_214] (rows=97302218301 width=807)
+                      Merge Join Operator [MERGEJOIN_214] (rows=4248052730 width=807)
                         Conds:RS_42._col6=RS_246._col0(Inner),Output:["_col3","_col10","_col16","_col19","_col20","_col22","_col23"]
                       <-Map 17 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_246]
@@ -156,7 +156,7 @@ Stage-0
                       <-Reducer 4 [SIMPLE_EDGE]
                         SHUFFLE [RS_42]
                           PartitionCols:_col6
-                          Merge Join Operator [MERGEJOIN_213] (rows=97302218301 width=527)
+                          Merge Join Operator [MERGEJOIN_213] (rows=4248052730 width=527)
                             Conds:RS_39._col8=RS_244._col0(Inner),Output:["_col3","_col6","_col10","_col16","_col19","_col20"]
                           <-Map 16 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_244]
@@ -168,17 +168,17 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_39]
                               PartitionCols:_col8
-                              Merge Join Operator [MERGEJOIN_212] (rows=97302218301 width=343)
+                              Merge Join Operator [MERGEJOIN_212] (rows=4248052730 width=343)
                                 Conds:RS_36._col1, _col2=RS_37._col9, _col8(Inner),Output:["_col3","_col6","_col8","_col10","_col16"]
                               <-Reducer 11 [SIMPLE_EDGE]
                                 SHUFFLE [RS_37]
                                   PartitionCols:_col9, _col8
-                                  Merge Join Operator [MERGEJOIN_211] (rows=478292911 width=234)
+                                  Merge Join Operator [MERGEJOIN_211] (rows=21091882 width=154)
                                     Conds:RS_25._col2, _col1, _col4=RS_26._col2, _col1, _col3(Inner),Output:["_col1","_col3","_col5","_col8","_col9","_col11"]
                                   <-Reducer 10 [SIMPLE_EDGE]
                                     SHUFFLE [RS_25]
                                       PartitionCols:_col2, _col1, _col4
-                                      Merge Join Operator [MERGEJOIN_209] (rows=501694138 width=122)
+                                      Merge Join Operator [MERGEJOIN_209] (rows=13737330 width=8)
                                         Conds:RS_239._col0=RS_223._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_223]
@@ -212,7 +212,7 @@ Stage-0
                                   <-Reducer 13 [SIMPLE_EDGE]
                                     SHUFFLE [RS_26]
                                       PartitionCols:_col2, _col1, _col3
-                                      Merge Join Operator [MERGEJOIN_210] (rows=53632139 width=119)
+                                      Merge Join Operator [MERGEJOIN_210] (rows=9402909 width=100)
                                         Conds:RS_242._col0=RS_225._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_225]
@@ -234,7 +234,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_36]
                                   PartitionCols:_col1, _col2
-                                  Merge Join Operator [MERGEJOIN_208] (rows=285117831 width=119)
+                                  Merge Join Operator [MERGEJOIN_208] (rows=54418158 width=119)
                                     Conds:RS_234._col0=RS_221._col0(Inner),Output:["_col1","_col2","_col3"]
                                   <-Map 8 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_221]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query26.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query26.q.out
index 44f7ce3..6a59e83 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query26.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query26.q.out
@@ -83,9 +83,9 @@ Stage-0
                     PartitionCols:_col0
                     Group By Operator [GBY_27] (rows=462000 width=476)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col4)","count(_col4)","sum(_col5)","count(_col5)","sum(_col7)","count(_col7)","sum(_col6)","count(_col6)"],keys:_col12
-                      Top N Key Operator [TNK_57] (rows=2317924 width=231)
+                      Top N Key Operator [TNK_57] (rows=809521 width=100)
                         keys:_col12,top n:100
-                        Merge Join Operator [MERGEJOIN_103] (rows=2317924 width=231)
+                        Merge Join Operator [MERGEJOIN_103] (rows=809521 width=100)
                           Conds:RS_23._col2=RS_122._col0(Inner),Output:["_col4","_col5","_col6","_col7","_col12"]
                         <-Map 12 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_122]
@@ -97,7 +97,7 @@ Stage-0
                         <-Reducer 4 [SIMPLE_EDGE]
                           SHUFFLE [RS_23]
                             PartitionCols:_col2
-                            Merge Join Operator [MERGEJOIN_102] (rows=2317924 width=135)
+                            Merge Join Operator [MERGEJOIN_102] (rows=809521 width=4)
                               Conds:RS_20._col3=RS_120._col0(Inner),Output:["_col2","_col4","_col5","_col6","_col7"]
                             <-Map 11 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_120]
@@ -111,7 +111,7 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE]
                               SHUFFLE [RS_20]
                                 PartitionCols:_col3
-                                Merge Join Operator [MERGEJOIN_101] (rows=2317924 width=137)
+                                Merge Join Operator [MERGEJOIN_101] (rows=809521 width=4)
                                   Conds:RS_17._col0=RS_117._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6","_col7"]
                                 <-Map 10 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_117]
@@ -125,7 +125,7 @@ Stage-0
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_17]
                                     PartitionCols:_col0
-                                    Merge Join Operator [MERGEJOIN_100] (rows=2317924 width=139)
+                                    Merge Join Operator [MERGEJOIN_100] (rows=2283326 width=135)
                                       Conds:RS_114._col1=RS_106._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7"]
                                     <-Map 8 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_106]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query27.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query27.q.out
index 957f883..4f9060b 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query27.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query27.q.out
@@ -74,24 +74,24 @@ Stage-0
       File Output Operator [FS_129]
         Limit [LIM_128] (rows=100 width=538)
           Number of rows:100
-          Select Operator [SEL_127] (rows=6526254 width=538)
+          Select Operator [SEL_127] (rows=4281825 width=538)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_126]
-              Select Operator [SEL_125] (rows=6526254 width=538)
+              Select Operator [SEL_125] (rows=4281825 width=538)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                Group By Operator [GBY_124] (rows=6526254 width=570)
+                Group By Operator [GBY_124] (rows=4281825 width=570)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)","sum(VALUE._col2)","count(VALUE._col3)","sum(VALUE._col4)","count(VALUE._col5)","sum(VALUE._col6)","count(VALUE._col7)"],keys:KEY._col0, KEY._col1, KEY._col2
                 <-Reducer 5 [SIMPLE_EDGE]
                   SHUFFLE [RS_29]
                     PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_28] (rows=13907934 width=570)
+                    Group By Operator [GBY_28] (rows=4281825 width=570)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"],aggregations:["sum(_col2)","count(_col2)","sum(_col3)","count(_col3)","sum(_col4)","count(_col4)","sum(_col5)","count(_col5)"],keys:_col0, _col1, 0L
-                      Select Operator [SEL_26] (rows=4635978 width=186)
+                      Select Operator [SEL_26] (rows=1427275 width=186)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                        Top N Key Operator [TNK_58] (rows=4635978 width=186)
+                        Top N Key Operator [TNK_58] (rows=1427275 width=186)
                           keys:_col13, _col11,top n:100
-                          Merge Join Operator [MERGEJOIN_104] (rows=4635978 width=186)
+                          Merge Join Operator [MERGEJOIN_104] (rows=1427275 width=186)
                             Conds:RS_23._col1=RS_123._col0(Inner),Output:["_col4","_col5","_col6","_col7","_col11","_col13"]
                           <-Map 12 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_123]
@@ -103,7 +103,7 @@ Stage-0
                           <-Reducer 4 [SIMPLE_EDGE]
                             SHUFFLE [RS_23]
                               PartitionCols:_col1
-                              Merge Join Operator [MERGEJOIN_103] (rows=4635978 width=90)
+                              Merge Join Operator [MERGEJOIN_103] (rows=1427275 width=90)
                                 Conds:RS_20._col3=RS_121._col0(Inner),Output:["_col1","_col4","_col5","_col6","_col7","_col11"]
                               <-Map 11 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_121]
@@ -117,7 +117,7 @@ Stage-0
                               <-Reducer 3 [SIMPLE_EDGE]
                                 SHUFFLE [RS_20]
                                   PartitionCols:_col3
-                                  Merge Join Operator [MERGEJOIN_102] (rows=4635978 width=4)
+                                  Merge Join Operator [MERGEJOIN_102] (rows=1441779 width=4)
                                     Conds:RS_17._col0=RS_118._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7"]
                                   <-Map 10 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_118]
@@ -131,7 +131,7 @@ Stage-0
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_17]
                                       PartitionCols:_col0
-                                      Merge Join Operator [MERGEJOIN_101] (rows=4635978 width=4)
+                                      Merge Join Operator [MERGEJOIN_101] (rows=4037920 width=4)
                                         Conds:RS_115._col2=RS_107._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_107]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query29.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query29.q.out
index 2895200..dff4cc8 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query29.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query29.q.out
@@ -129,20 +129,20 @@ Stage-0
       File Output Operator [FS_251]
         Limit [LIM_250] (rows=100 width=496)
           Number of rows:100
-          Select Operator [SEL_249] (rows=97302218301 width=496)
+          Select Operator [SEL_249] (rows=4156223234 width=496)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_248]
-              Group By Operator [GBY_247] (rows=97302218301 width=496)
+              Group By Operator [GBY_247] (rows=4156223234 width=496)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
               <-Reducer 5 [SIMPLE_EDGE]
                 SHUFFLE [RS_47]
                   PartitionCols:_col0, _col1, _col2, _col3
-                  Group By Operator [GBY_46] (rows=97302218301 width=496)
+                  Group By Operator [GBY_46] (rows=4156223234 width=496)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col10)","sum(_col16)","sum(_col3)"],keys:_col22, _col23, _col19, _col20
-                    Top N Key Operator [TNK_96] (rows=97302218301 width=483)
+                    Top N Key Operator [TNK_96] (rows=4156223234 width=483)
                       keys:_col22, _col23, _col19, _col20,top n:100
-                      Merge Join Operator [MERGEJOIN_214] (rows=97302218301 width=483)
+                      Merge Join Operator [MERGEJOIN_214] (rows=4156223234 width=483)
                         Conds:RS_42._col6=RS_246._col0(Inner),Output:["_col3","_col10","_col16","_col19","_col20","_col22","_col23"]
                       <-Map 18 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_246]
@@ -154,7 +154,7 @@ Stage-0
                       <-Reducer 4 [SIMPLE_EDGE]
                         SHUFFLE [RS_42]
                           PartitionCols:_col6
-                          Merge Join Operator [MERGEJOIN_213] (rows=97302218301 width=203)
+                          Merge Join Operator [MERGEJOIN_213] (rows=4156223234 width=203)
                             Conds:RS_39._col8=RS_244._col0(Inner),Output:["_col3","_col6","_col10","_col16","_col19","_col20"]
                           <-Map 17 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_244]
@@ -166,17 +166,17 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_39]
                               PartitionCols:_col8
-                              Merge Join Operator [MERGEJOIN_212] (rows=97302218301 width=19)
+                              Merge Join Operator [MERGEJOIN_212] (rows=4156223234 width=19)
                                 Conds:RS_36._col1, _col2=RS_37._col9, _col8(Inner),Output:["_col3","_col6","_col8","_col10","_col16"]
                               <-Reducer 12 [SIMPLE_EDGE]
                                 SHUFFLE [RS_37]
                                   PartitionCols:_col9, _col8
-                                  Merge Join Operator [MERGEJOIN_211] (rows=478292911 width=23)
+                                  Merge Join Operator [MERGEJOIN_211] (rows=21091879 width=18)
                                     Conds:RS_25._col2, _col1, _col4=RS_26._col2, _col1, _col3(Inner),Output:["_col1","_col3","_col5","_col8","_col9","_col11"]
                                   <-Reducer 11 [SIMPLE_EDGE]
                                     SHUFFLE [RS_25]
                                       PartitionCols:_col2, _col1, _col4
-                                      Merge Join Operator [MERGEJOIN_209] (rows=501694138 width=19)
+                                      Merge Join Operator [MERGEJOIN_209] (rows=13737330 width=8)
                                         Conds:RS_239._col0=RS_230._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"]
                                       <-Map 13 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_230]
@@ -210,7 +210,7 @@ Stage-0
                                   <-Reducer 15 [SIMPLE_EDGE]
                                     SHUFFLE [RS_26]
                                       PartitionCols:_col2, _col1, _col3
-                                      Merge Join Operator [MERGEJOIN_210] (rows=53632139 width=15)
+                                      Merge Join Operator [MERGEJOIN_210] (rows=5384572 width=13)
                                         Conds:RS_242._col0=RS_232._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                       <-Map 13 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_232]
@@ -232,7 +232,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_36]
                                   PartitionCols:_col1, _col2
-                                  Merge Join Operator [MERGEJOIN_208] (rows=285117831 width=11)
+                                  Merge Join Operator [MERGEJOIN_208] (rows=7638375 width=10)
                                     Conds:RS_225._col0=RS_217._col0(Inner),Output:["_col1","_col2","_col3"]
                                   <-Map 8 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_217]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query3.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query3.q.out
index 4137a53..80c66df 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query3.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query3.q.out
@@ -64,22 +64,22 @@ Stage-0
       File Output Operator [FS_77]
         Limit [LIM_76] (rows=100 width=220)
           Number of rows:100
-          Select Operator [SEL_75] (rows=7666836 width=219)
+          Select Operator [SEL_75] (rows=274400 width=219)
             Output:["_col0","_col1","_col2","_col3"]
           <-Reducer 4 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_74]
-              Top N Key Operator [TNK_73] (rows=7666836 width=219)
+              Top N Key Operator [TNK_73] (rows=274400 width=219)
                 keys:_col0, _col3, _col1,top n:100
-                Group By Operator [GBY_72] (rows=7666836 width=219)
+                Group By Operator [GBY_72] (rows=274400 width=219)
                   Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                 <-Reducer 3 [SIMPLE_EDGE]
                   SHUFFLE [RS_17]
                     PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_16] (rows=7666836 width=219)
+                    Group By Operator [GBY_16] (rows=274400 width=219)
                       Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)"],keys:_col7, _col4, _col5
-                      Top N Key Operator [TNK_35] (rows=7666836 width=108)
+                      Top N Key Operator [TNK_35] (rows=589741 width=108)
                         keys:_col7,top n:100
-                        Merge Join Operator [MERGEJOIN_57] (rows=7666836 width=108)
+                        Merge Join Operator [MERGEJOIN_57] (rows=589741 width=108)
                           Conds:RS_12._col0=RS_71._col0(Inner),Output:["_col2","_col4","_col5","_col7"]
                         <-Map 8 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_71]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query30.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query30.q.out
index e8f1957..ee51918 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query30.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query30.q.out
@@ -88,17 +88,17 @@ Stage-0
     Stage-1
       Reducer 4 vectorized
       File Output Operator [FS_216]
-        Limit [LIM_215] (rows=100 width=945)
+        Limit [LIM_215] (rows=100 width=942)
           Number of rows:100
-          Select Operator [SEL_214] (rows=4179738 width=944)
+          Select Operator [SEL_214] (rows=704993 width=930)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
           <-Reducer 3 [SIMPLE_EDGE]
             SHUFFLE [RS_66]
-              Select Operator [SEL_65] (rows=4179738 width=944)
+              Select Operator [SEL_65] (rows=704993 width=930)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
-                Top N Key Operator [TNK_104] (rows=4179738 width=949)
+                Top N Key Operator [TNK_104] (rows=704993 width=942)
                   keys:_col1, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col17,top n:100
-                  Merge Join Operator [MERGEJOIN_181] (rows=4179738 width=949)
+                  Merge Join Operator [MERGEJOIN_181] (rows=704993 width=942)
                     Conds:RS_62._col0=RS_63._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col17"]
                   <-Reducer 2 [SIMPLE_EDGE]
                     SHUFFLE [RS_62]
@@ -126,31 +126,31 @@ Stage-0
                   <-Reducer 8 [SIMPLE_EDGE]
                     SHUFFLE [RS_63]
                       PartitionCols:_col0
-                      Select Operator [SEL_58] (rows=4179738 width=227)
+                      Select Operator [SEL_58] (rows=704993 width=227)
                         Output:["_col0","_col2"]
-                        Filter Operator [FIL_57] (rows=4179738 width=227)
+                        Filter Operator [FIL_57] (rows=704993 width=227)
                           predicate:(_col2 > _col3)
-                          Merge Join Operator [MERGEJOIN_180] (rows=12539214 width=227)
+                          Merge Join Operator [MERGEJOIN_180] (rows=2114980 width=227)
                             Conds:RS_207._col1=RS_213._col1(Inner),Output:["_col0","_col2","_col3"]
                           <-Reducer 10 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_213]
                               PartitionCols:_col1
-                              Select Operator [SEL_212] (rows=17 width=198)
+                              Select Operator [SEL_212] (rows=6 width=198)
                                 Output:["_col0","_col1"]
-                                Filter Operator [FIL_211] (rows=17 width=206)
+                                Filter Operator [FIL_211] (rows=6 width=206)
                                   predicate:CAST( (_col1 / _col2) AS decimal(21,6)) is not null
-                                  Group By Operator [GBY_210] (rows=17 width=206)
+                                  Group By Operator [GBY_210] (rows=6 width=206)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)","count(_col2)"],keys:_col0
-                                    Select Operator [SEL_209] (rows=13130761 width=201)
+                                    Select Operator [SEL_209] (rows=2537976 width=201)
                                       Output:["_col0","_col2"]
-                                      Group By Operator [GBY_208] (rows=13130761 width=201)
+                                      Group By Operator [GBY_208] (rows=2537976 width=201)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                       <-Reducer 9 [SIMPLE_EDGE]
                                         SHUFFLE [RS_45]
                                           PartitionCols:_col0
-                                          Group By Operator [GBY_44] (rows=13130761 width=201)
+                                          Group By Operator [GBY_44] (rows=3923529 width=201)
                                             Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col6, _col1
-                                            Merge Join Operator [MERGEJOIN_179] (rows=13130761 width=196)
+                                            Merge Join Operator [MERGEJOIN_179] (rows=3923529 width=184)
                                               Conds:RS_40._col2=RS_193._col0(Inner),Output:["_col1","_col3","_col6"]
                                             <-Map 5 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_193]
@@ -163,7 +163,7 @@ Stage-0
                                             <-Reducer 13 [SIMPLE_EDGE]
                                               SHUFFLE [RS_40]
                                                 PartitionCols:_col2
-                                                Merge Join Operator [MERGEJOIN_178] (rows=13130761 width=114)
+                                                Merge Join Operator [MERGEJOIN_178] (rows=3923529 width=101)
                                                   Conds:RS_199._col0=RS_203._col0(Inner),Output:["_col1","_col2","_col3"]
                                                 <-Map 11 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_199]
@@ -186,18 +186,18 @@ Stage-0
                           <-Reducer 7 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_207]
                               PartitionCols:_col1
-                              Filter Operator [FIL_206] (rows=12539214 width=201)
+                              Filter Operator [FIL_206] (rows=2114980 width=201)
                                 predicate:_col2 is not null
-                                Select Operator [SEL_205] (rows=12539214 width=201)
+                                Select Operator [SEL_205] (rows=2114980 width=201)
                                   Output:["_col0","_col1","_col2"]
-                                  Group By Operator [GBY_204] (rows=12539214 width=201)
+                                  Group By Operator [GBY_204] (rows=2114980 width=201)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                   <-Reducer 6 [SIMPLE_EDGE]
                                     SHUFFLE [RS_23]
                                       PartitionCols:_col0, _col1
-                                      Group By Operator [GBY_22] (rows=12539214 width=201)
+                                      Group By Operator [GBY_22] (rows=3746772 width=201)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col6, _col1
-                                        Merge Join Operator [MERGEJOIN_177] (rows=12539214 width=196)
+                                        Merge Join Operator [MERGEJOIN_177] (rows=3746772 width=184)
                                           Conds:RS_18._col2=RS_192._col0(Inner),Output:["_col1","_col3","_col6"]
                                         <-Map 5 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_192]
@@ -210,7 +210,7 @@ Stage-0
                                         <-Reducer 12 [SIMPLE_EDGE]
                                           SHUFFLE [RS_18]
                                             PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_176] (rows=12539214 width=114)
+                                            Merge Join Operator [MERGEJOIN_176] (rows=3746772 width=101)
                                               Conds:RS_198._col0=RS_202._col0(Inner),Output:["_col1","_col2","_col3"]
                                             <-Map 11 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_198]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query31.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query31.q.out
index ed4cee4..6364d87 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query31.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query31.q.out
@@ -155,33 +155,33 @@ Stage-0
     Stage-1
       Reducer 7
       File Output Operator [FS_139]
-        Select Operator [SEL_138] (rows=429 width=550)
+        Select Operator [SEL_138] (rows=110 width=550)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-          Filter Operator [FIL_136] (rows=429 width=778)
+          Filter Operator [FIL_136] (rows=110 width=778)
             predicate:(CASE WHEN ((_col9 > 0)) THEN (CASE WHEN (_col7) THEN (((_col4 / _col6) > (_col13 / _col9))) ELSE (false) END) ELSE (false) END and CASE WHEN ((_col11 > 0)) THEN (CASE WHEN (_col2) THEN (((_col6 / _col1) > (_col9 / _col11))) ELSE (false) END) ELSE (false) END)
-            Merge Join Operator [MERGEJOIN_450] (rows=1716 width=778)
+            Merge Join Operator [MERGEJOIN_450] (rows=440 width=778)
               Conds:RS_133._col0=RS_134._col0(Inner),Output:["_col1","_col2","_col4","_col6","_col7","_col8","_col9","_col11","_col13"]
             <-Reducer 22 [SIMPLE_EDGE]
               SHUFFLE [RS_134]
                 PartitionCols:_col0
-                Merge Join Operator [MERGEJOIN_448] (rows=1716 width=434)
+                Merge Join Operator [MERGEJOIN_448] (rows=1605 width=434)
                   Conds:RS_123._col0=RS_538._col0(Inner),Output:["_col0","_col1","_col3","_col5"]
                 <-Reducer 21 [SIMPLE_EDGE]
                   SHUFFLE [RS_123]
                     PartitionCols:_col0
-                    Merge Join Operator [MERGEJOIN_447] (rows=1716 width=322)
+                    Merge Join Operator [MERGEJOIN_447] (rows=1605 width=322)
                       Conds:RS_524._col0=RS_531._col0(Inner),Output:["_col0","_col1","_col3"]
                     <-Reducer 20 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_524]
                         PartitionCols:_col0
-                        Group By Operator [GBY_523] (rows=1716 width=210)
+                        Group By Operator [GBY_523] (rows=1605 width=210)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 19 [SIMPLE_EDGE]
                           SHUFFLE [RS_77]
                             PartitionCols:_col0
-                            Group By Operator [GBY_76] (rows=722436 width=210)
+                            Group By Operator [GBY_76] (rows=33705 width=210)
                               Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                              Merge Join Operator [MERGEJOIN_441] (rows=525327191 width=204)
+                              Merge Join Operator [MERGEJOIN_441] (rows=37399561 width=139)
                                 Conds:RS_72._col1=RS_497._col0(Inner),Output:["_col2","_col5"]
                               <-Map 32 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_497]
@@ -195,7 +195,7 @@ Stage-0
                               <-Reducer 18 [SIMPLE_EDGE]
                                 SHUFFLE [RS_72]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_440] (rows=525327191 width=110)
+                                  Merge Join Operator [MERGEJOIN_440] (rows=37399561 width=42)
                                     Conds:RS_522._col0=RS_469._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 8 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_469]
@@ -229,14 +229,14 @@ Stage-0
                     <-Reducer 26 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_531]
                         PartitionCols:_col0
-                        Group By Operator [GBY_530] (rows=1716 width=210)
+                        Group By Operator [GBY_530] (rows=1605 width=210)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 25 [SIMPLE_EDGE]
                           SHUFFLE [RS_97]
                             PartitionCols:_col0
-                            Group By Operator [GBY_96] (rows=722436 width=210)
+                            Group By Operator [GBY_96] (rows=33705 width=210)
                               Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                              Merge Join Operator [MERGEJOIN_443] (rows=525327191 width=204)
+                              Merge Join Operator [MERGEJOIN_443] (rows=37399561 width=139)
                                 Conds:RS_92._col1=RS_498._col0(Inner),Output:["_col2","_col5"]
                               <-Map 32 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_498]
@@ -245,7 +245,7 @@ Stage-0
                               <-Reducer 24 [SIMPLE_EDGE]
                                 SHUFFLE [RS_92]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_442] (rows=525327191 width=110)
+                                  Merge Join Operator [MERGEJOIN_442] (rows=37399561 width=42)
                                     Conds:RS_529._col0=RS_471._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 8 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_471]
@@ -278,14 +278,14 @@ Stage-0
                 <-Reducer 30 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_538]
                     PartitionCols:_col0
-                    Group By Operator [GBY_537] (rows=1716 width=210)
+                    Group By Operator [GBY_537] (rows=1605 width=210)
                       Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                     <-Reducer 29 [SIMPLE_EDGE]
                       SHUFFLE [RS_117]
                         PartitionCols:_col0
-                        Group By Operator [GBY_116] (rows=722436 width=210)
+                        Group By Operator [GBY_116] (rows=33705 width=210)
                           Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                          Merge Join Operator [MERGEJOIN_445] (rows=525327191 width=204)
+                          Merge Join Operator [MERGEJOIN_445] (rows=37399561 width=139)
                             Conds:RS_112._col1=RS_499._col0(Inner),Output:["_col2","_col5"]
                           <-Map 32 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_499]
@@ -294,7 +294,7 @@ Stage-0
                           <-Reducer 28 [SIMPLE_EDGE]
                             SHUFFLE [RS_112]
                               PartitionCols:_col1
-                              Merge Join Operator [MERGEJOIN_444] (rows=525327191 width=110)
+                              Merge Join Operator [MERGEJOIN_444] (rows=37399561 width=42)
                                 Conds:RS_536._col0=RS_473._col0(Inner),Output:["_col1","_col2"]
                               <-Map 8 [SIMPLE_EDGE] vectorized
                                 PARTITION_ONLY_SHUFFLE [RS_473]
@@ -327,21 +327,21 @@ Stage-0
             <-Reducer 6 [SIMPLE_EDGE]
               SHUFFLE [RS_133]
                 PartitionCols:_col0
-                Merge Join Operator [MERGEJOIN_449] (rows=1716 width=442)
+                Merge Join Operator [MERGEJOIN_449] (rows=440 width=442)
                   Conds:RS_130._col0=RS_517._col0(Inner),Output:["_col0","_col1","_col2","_col4","_col6","_col7"]
                 <-Reducer 16 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_517]
                     PartitionCols:_col0
-                    Select Operator [SEL_516] (rows=1716 width=214)
+                    Select Operator [SEL_516] (rows=440 width=214)
                       Output:["_col0","_col1","_col2"]
-                      Group By Operator [GBY_515] (rows=1716 width=210)
+                      Group By Operator [GBY_515] (rows=440 width=210)
                         Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                       <-Reducer 15 [SIMPLE_EDGE]
                         SHUFFLE [RS_57]
                           PartitionCols:_col0
-                          Group By Operator [GBY_56] (rows=204204 width=210)
+                          Group By Operator [GBY_56] (rows=3960 width=210)
                             Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                            Merge Join Operator [MERGEJOIN_439] (rows=143931246 width=209)
+                            Merge Join Operator [MERGEJOIN_439] (rows=10246882 width=209)
                               Conds:RS_52._col1=RS_496._col0(Inner),Output:["_col2","_col5"]
                             <-Map 32 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_496]
@@ -350,7 +350,7 @@ Stage-0
                             <-Reducer 14 [SIMPLE_EDGE]
                               SHUFFLE [RS_52]
                                 PartitionCols:_col1
-                                Merge Join Operator [MERGEJOIN_438] (rows=143931246 width=115)
+                                Merge Join Operator [MERGEJOIN_438] (rows=10246882 width=115)
                                   Conds:RS_514._col0=RS_467._col0(Inner),Output:["_col1","_col2"]
                                 <-Map 8 [SIMPLE_EDGE] vectorized
                                   PARTITION_ONLY_SHUFFLE [RS_467]
@@ -383,19 +383,19 @@ Stage-0
                 <-Reducer 5 [SIMPLE_EDGE]
                   SHUFFLE [RS_130]
                     PartitionCols:_col0
-                    Merge Join Operator [MERGEJOIN_446] (rows=1716 width=326)
+                    Merge Join Operator [MERGEJOIN_446] (rows=440 width=326)
                       Conds:RS_502._col0=RS_509._col0(Inner),Output:["_col0","_col1","_col2","_col4"]
                     <-Reducer 12 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_509]
                         PartitionCols:_col0
-                        Group By Operator [GBY_508] (rows=1716 width=210)
+                        Group By Operator [GBY_508] (rows=440 width=210)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 11 [SIMPLE_EDGE]
                           SHUFFLE [RS_37]
                             PartitionCols:_col0
-                            Group By Operator [GBY_36] (rows=204204 width=210)
+                            Group By Operator [GBY_36] (rows=3960 width=210)
                               Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                              Merge Join Operator [MERGEJOIN_437] (rows=143931246 width=209)
+                              Merge Join Operator [MERGEJOIN_437] (rows=10246882 width=209)
                                 Conds:RS_32._col1=RS_495._col0(Inner),Output:["_col2","_col5"]
                               <-Map 32 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_495]
@@ -404,7 +404,7 @@ Stage-0
                               <-Reducer 10 [SIMPLE_EDGE]
                                 SHUFFLE [RS_32]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_436] (rows=143931246 width=115)
+                                  Merge Join Operator [MERGEJOIN_436] (rows=10246882 width=115)
                                     Conds:RS_507._col0=RS_465._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 8 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_465]
@@ -437,16 +437,16 @@ Stage-0
                     <-Reducer 4 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_502]
                         PartitionCols:_col0
-                        Select Operator [SEL_501] (rows=1716 width=214)
+                        Select Operator [SEL_501] (rows=440 width=214)
                           Output:["_col0","_col1","_col2"]
-                          Group By Operator [GBY_500] (rows=1716 width=210)
+                          Group By Operator [GBY_500] (rows=440 width=210)
                             Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_17]
                               PartitionCols:_col0
-                              Group By Operator [GBY_16] (rows=204204 width=210)
+                              Group By Operator [GBY_16] (rows=3960 width=210)
                                 Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                                Merge Join Operator [MERGEJOIN_435] (rows=143931246 width=209)
+                                Merge Join Operator [MERGEJOIN_435] (rows=10246882 width=209)
                                   Conds:RS_12._col1=RS_494._col0(Inner),Output:["_col2","_col5"]
                                 <-Map 32 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_494]
@@ -455,7 +455,7 @@ Stage-0
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_12]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_434] (rows=143931246 width=115)
+                                    Merge Join Operator [MERGEJOIN_434] (rows=10246882 width=115)
                                       Conds:RS_491._col0=RS_463._col0(Inner),Output:["_col1","_col2"]
                                     <-Map 8 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_463]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query32.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query32.q.out
index 2f94f86..6d8eec6 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query32.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query32.q.out
@@ -84,16 +84,16 @@ Stage-0
           PARTITION_ONLY_SHUFFLE [RS_36]
             Group By Operator [GBY_35] (rows=1 width=112)
               Output:["_col0"],aggregations:["sum(_col2)"]
-              Select Operator [SEL_34] (rows=20854 width=112)
+              Select Operator [SEL_34] (rows=2317 width=112)
                 Output:["_col2"]
-                Filter Operator [FIL_33] (rows=20854 width=112)
+                Filter Operator [FIL_33] (rows=2317 width=112)
                   predicate:(_col2 > _col6)
-                  Merge Join Operator [MERGEJOIN_103] (rows=62562 width=112)
+                  Merge Join Operator [MERGEJOIN_103] (rows=6951 width=112)
                     Conds:RS_30._col4=RS_125._col0(Inner),Output:["_col2","_col6"]
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_30]
                       PartitionCols:_col4
-                      Merge Join Operator [MERGEJOIN_101] (rows=3973887 width=75)
+                      Merge Join Operator [MERGEJOIN_101] (rows=441513 width=4)
                         Conds:RS_27._col1=RS_106._col0(Inner),Output:["_col2","_col4"]
                       <-Map 9 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_106]
@@ -107,7 +107,7 @@ Stage-0
                       <-Reducer 2 [SIMPLE_EDGE]
                         SHUFFLE [RS_27]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_100] (rows=285116600 width=115)
+                          Merge Join Operator [MERGEJOIN_100] (rows=31677454 width=110)
                             Conds:RS_116._col0=RS_120._col0(Inner),Output:["_col1","_col2"]
                           <-Map 1 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_116]
@@ -141,18 +141,18 @@ Stage-0
                   <-Reducer 7 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_125]
                       PartitionCols:_col0
-                      Select Operator [SEL_124] (rows=62562 width=116)
+                      Select Operator [SEL_124] (rows=6951 width=116)
                         Output:["_col0","_col1"]
-                        Filter Operator [FIL_123] (rows=62562 width=124)
+                        Filter Operator [FIL_123] (rows=6951 width=124)
                           predicate:CAST( (1.3 * CAST( (_col1 / _col2) AS decimal(11,6))) AS decimal(14,7)) is not null
-                          Group By Operator [GBY_122] (rows=62562 width=124)
+                          Group By Operator [GBY_122] (rows=6951 width=124)
                             Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0
                           <-Reducer 6 [SIMPLE_EDGE]
                             SHUFFLE [RS_20]
                               PartitionCols:_col0
-                              Group By Operator [GBY_19] (rows=8133060 width=124)
+                              Group By Operator [GBY_19] (rows=97314 width=124)
                                 Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)","count(_col2)"],keys:_col1
-                                Merge Join Operator [MERGEJOIN_102] (rows=286549727 width=115)
+                                Merge Join Operator [MERGEJOIN_102] (rows=31836679 width=110)
                                   Conds:RS_117._col0=RS_121._col0(Inner),Output:["_col1","_col2"]
                                 <-Map 1 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_117]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query33.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query33.q.out
index 63a5cd9..bba2eb4 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query33.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query33.q.out
@@ -192,35 +192,35 @@ Stage-0
     Stage-1
       Reducer 7 vectorized
       File Output Operator [FS_359]
-        Limit [LIM_358] (rows=7 width=116)
+        Limit [LIM_358] (rows=59 width=115)
           Number of rows:100
-          Select Operator [SEL_357] (rows=7 width=116)
+          Select Operator [SEL_357] (rows=59 width=115)
             Output:["_col0","_col1"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_356]
-              Top N Key Operator [TNK_355] (rows=7 width=116)
+              Top N Key Operator [TNK_355] (rows=59 width=115)
                 keys:_col1,top n:100
-                Group By Operator [GBY_354] (rows=7 width=116)
+                Group By Operator [GBY_354] (rows=59 width=115)
                   Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                 <-Union 5 [SIMPLE_EDGE]
                   <-Reducer 11 [CONTAINS] vectorized
                     Reduce Output Operator [RS_375]
                       PartitionCols:_col0
-                      Group By Operator [GBY_374] (rows=7 width=116)
+                      Group By Operator [GBY_374] (rows=59 width=115)
                         Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
-                        Group By Operator [GBY_373] (rows=7 width=116)
+                        Group By Operator [GBY_373] (rows=19 width=115)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 10 [SIMPLE_EDGE]
                           SHUFFLE [RS_109]
                             PartitionCols:_col0
-                            Group By Operator [GBY_108] (rows=8 width=116)
+                            Group By Operator [GBY_108] (rows=19 width=115)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_305] (rows=206906 width=96)
+                              Merge Join Operator [MERGEJOIN_305] (rows=11364 width=3)
                                 Conds:RS_104._col0=RS_105._col2(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_104]
                                   PartitionCols:_col0
-                                  Merge Join Operator [MERGEJOIN_294] (rows=46084 width=7)
+                                  Merge Join Operator [MERGEJOIN_294] (rows=461514 width=7)
                                     Conds:RS_320._col1=RS_326._col0(Inner),Output:["_col0","_col1"]
                                   <-Map 1 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_320]
@@ -234,12 +234,12 @@ Stage-0
                                   <-Reducer 13 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_326]
                                       PartitionCols:_col0
-                                      Group By Operator [GBY_325] (rows=69 width=4)
+                                      Group By Operator [GBY_325] (rows=692 width=3)
                                         Output:["_col0"],keys:KEY._col0
                                       <-Map 12 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_324]
                                           PartitionCols:_col0
-                                          Group By Operator [GBY_323] (rows=70 width=4)
+                                          Group By Operator [GBY_323] (rows=692 width=3)
                                             Output:["_col0"],keys:i_manufact_id
                                             Select Operator [SEL_322] (rows=46085 width=93)
                                               Output:["i_manufact_id"]
@@ -250,9 +250,9 @@ Stage-0
                               <-Reducer 23 [SIMPLE_EDGE]
                                 SHUFFLE [RS_105]
                                   PartitionCols:_col2
-                                  Select Operator [SEL_100] (rows=143931246 width=115)
+                                  Select Operator [SEL_100] (rows=788222 width=110)
                                     Output:["_col2","_col4"]
-                                    Merge Join Operator [MERGEJOIN_302] (rows=143931246 width=115)
+                                    Merge Join Operator [MERGEJOIN_302] (rows=788222 width=110)
                                       Conds:RS_97._col2=RS_350._col0(Inner),Output:["_col1","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_350]
@@ -266,7 +266,7 @@ Stage-0
                                     <-Reducer 22 [SIMPLE_EDGE]
                                       SHUFFLE [RS_97]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_301] (rows=143931246 width=119)
+                                        Merge Join Operator [MERGEJOIN_301] (rows=3941109 width=118)
                                           Conds:RS_372._col0=RS_333._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_333]
@@ -300,16 +300,16 @@ Stage-0
                   <-Reducer 4 [CONTAINS] vectorized
                     Reduce Output Operator [RS_353]
                       PartitionCols:_col0
-                      Group By Operator [GBY_352] (rows=7 width=116)
+                      Group By Operator [GBY_352] (rows=59 width=115)
                         Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
-                        Group By Operator [GBY_351] (rows=7 width=116)
+                        Group By Operator [GBY_351] (rows=64 width=115)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_34]
                             PartitionCols:_col0
-                            Group By Operator [GBY_33] (rows=8 width=116)
+                            Group By Operator [GBY_33] (rows=64 width=115)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_303] (rows=755172 width=3)
+                              Merge Join Operator [MERGEJOIN_303] (rows=41476 width=3)
                                 Conds:RS_29._col0=RS_30._col2(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_29]
@@ -318,9 +318,9 @@ Stage-0
                               <-Reducer 16 [SIMPLE_EDGE]
                                 SHUFFLE [RS_30]
                                   PartitionCols:_col2
-                                  Select Operator [SEL_25] (rows=525327191 width=110)
+                                  Select Operator [SEL_25] (rows=2876890 width=4)
                                     Output:["_col2","_col4"]
-                                    Merge Join Operator [MERGEJOIN_296] (rows=525327191 width=110)
+                                    Merge Join Operator [MERGEJOIN_296] (rows=2876890 width=4)
                                       Conds:RS_22._col2=RS_348._col0(Inner),Output:["_col1","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_348]
@@ -329,7 +329,7 @@ Stage-0
                                     <-Reducer 15 [SIMPLE_EDGE]
                                       SHUFFLE [RS_22]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_295] (rows=525327191 width=114)
+                                        Merge Join Operator [MERGEJOIN_295] (rows=14384447 width=4)
                                           Conds:RS_345._col0=RS_329._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_329]
@@ -358,16 +358,16 @@ Stage-0
                   <-Reducer 9 [CONTAINS] vectorized
                     Reduce Output Operator [RS_367]
                       PartitionCols:_col0
-                      Group By Operator [GBY_366] (rows=7 width=116)
+                      Group By Operator [GBY_366] (rows=59 width=115)
                         Output:["_col0","_col1"],aggregations:["sum(_col1)"],keys:_col0
-                        Group By Operator [GBY_365] (rows=7 width=116)
+                        Group By Operator [GBY_365] (rows=35 width=115)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 8 [SIMPLE_EDGE]
                           SHUFFLE [RS_71]
                             PartitionCols:_col0
-                            Group By Operator [GBY_70] (rows=8 width=116)
+                            Group By Operator [GBY_70] (rows=35 width=115)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_304] (rows=409865 width=3)
+                              Merge Join Operator [MERGEJOIN_304] (rows=22352 width=3)
                                 Conds:RS_66._col0=RS_67._col3(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_66]
@@ -376,9 +376,9 @@ Stage-0
                               <-Reducer 20 [SIMPLE_EDGE]
                                 SHUFFLE [RS_67]
                                   PartitionCols:_col3
-                                  Select Operator [SEL_62] (rows=285117733 width=115)
+                                  Select Operator [SEL_62] (rows=1550375 width=13)
                                     Output:["_col3","_col4"]
-                                    Merge Join Operator [MERGEJOIN_299] (rows=285117733 width=115)
+                                    Merge Join Operator [MERGEJOIN_299] (rows=1550375 width=13)
                                       Conds:RS_59._col1=RS_349._col0(Inner),Output:["_col2","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_349]
@@ -387,7 +387,7 @@ Stage-0
                                     <-Reducer 19 [SIMPLE_EDGE]
                                       SHUFFLE [RS_59]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_298] (rows=285117733 width=119)
+                                        Merge Join Operator [MERGEJOIN_298] (rows=7751872 width=98)
                                           Conds:RS_364._col0=RS_331._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_331]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query34.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query34.q.out
index 9dab813..f43a27a 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query34.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query34.q.out
@@ -106,18 +106,18 @@ Stage-0
               <-Reducer 8 [SIMPLE_EDGE] vectorized
                 SHUFFLE [RS_122]
                   PartitionCols:_col1
-                  Filter Operator [FIL_121] (rows=6 width=16)
+                  Filter Operator [FIL_121] (rows=6 width=12)
                     predicate:_col2 BETWEEN 15L AND 20L
-                    Select Operator [SEL_120] (rows=479121995 width=15)
+                    Select Operator [SEL_120] (rows=13251253 width=12)
                       Output:["_col0","_col1","_col2"]
-                      Group By Operator [GBY_119] (rows=479121995 width=15)
+                      Group By Operator [GBY_119] (rows=13251253 width=12)
                         Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
                       <-Reducer 7 [SIMPLE_EDGE]
                         SHUFFLE [RS_25]
                           PartitionCols:_col0, _col1
-                          Group By Operator [GBY_24] (rows=479121995 width=15)
+                          Group By Operator [GBY_24] (rows=13251253 width=12)
                             Output:["_col0","_col1","_col2"],aggregations:["count()"],keys:_col1, _col4
-                            Merge Join Operator [MERGEJOIN_98] (rows=479121995 width=7)
+                            Merge Join Operator [MERGEJOIN_98] (rows=13251253 width=4)
                               Conds:RS_20._col3=RS_118._col0(Inner),Output:["_col1","_col4"]
                             <-Map 12 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_118]
@@ -131,7 +131,7 @@ Stage-0
                             <-Reducer 6 [SIMPLE_EDGE]
                               SHUFFLE [RS_20]
                                 PartitionCols:_col3
-                                Merge Join Operator [MERGEJOIN_97] (rows=479121995 width=11)
+                                Merge Join Operator [MERGEJOIN_97] (rows=24979074 width=5)
                                   Conds:RS_17._col2=RS_115._col0(Inner),Output:["_col1","_col3","_col4"]
                                 <-Map 11 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_115]
@@ -145,7 +145,7 @@ Stage-0
                                 <-Reducer 5 [SIMPLE_EDGE]
                                   SHUFFLE [RS_17]
                                     PartitionCols:_col2
-                                    Merge Join Operator [MERGEJOIN_96] (rows=479121995 width=15)
+                                    Merge Join Operator [MERGEJOIN_96] (rows=156119211 width=14)
                                       Conds:RS_112._col0=RS_104._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                     <-Map 9 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_104]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query35.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query35.q.out
index ea0f0b5..099e134 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query35.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query35.q.out
@@ -167,34 +167,34 @@ Stage-0
                 <-Reducer 6 [SIMPLE_EDGE]
                   SHUFFLE [RS_66]
                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                    Group By Operator [GBY_65] (rows=2 width=336)
+                    Group By Operator [GBY_65] (rows=1 width=336)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15"],aggregations:["count()","sum(_col8)","count(_col8)","max(_col8)","sum(_col9)","count(_col9)","max(_col9)","sum(_col10)","count(_col10)","max(_col10)"],keys:_col4, _col6, _col7, _col8, _col9, _col10
-                      Select Operator [SEL_64] (rows=1401496 width=276)
+                      Select Operator [SEL_64] (rows=501891 width=276)
                         Output:["_col4","_col6","_col7","_col8","_col9","_col10"]
-                        Top N Key Operator [TNK_106] (rows=1401496 width=276)
+                        Top N Key Operator [TNK_106] (rows=501891 width=276)
                           keys:_col4, _col6, _col7, _col8, _col9, _col10,top n:100
-                          Filter Operator [FIL_63] (rows=1401496 width=276)
+                          Filter Operator [FIL_63] (rows=501891 width=276)
                             predicate:(_col11 is not null or _col13 is not null)
-                            Merge Join Operator [MERGEJOIN_186] (rows=1401496 width=276)
+                            Merge Join Operator [MERGEJOIN_186] (rows=501891 width=276)
                               Conds:RS_60._col0=RS_225._col1(Left Outer),Output:["_col4","_col6","_col7","_col8","_col9","_col10","_col11","_col13"]
                             <-Reducer 5 [SIMPLE_EDGE]
                               PARTITION_ONLY_SHUFFLE [RS_60]
                                 PartitionCols:_col0
-                                Merge Join Operator [MERGEJOIN_185] (rows=1414922 width=276)
+                                Merge Join Operator [MERGEJOIN_185] (rows=505464 width=276)
                                   Conds:RS_57._col0=RS_217._col1(Left Outer),Output:["_col0","_col4","_col6","_col7","_col8","_col9","_col10","_col11"]
                                 <-Reducer 17 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_217]
                                     PartitionCols:_col1
-                                    Select Operator [SEL_216] (rows=1414922 width=7)
+                                    Select Operator [SEL_216] (rows=505464 width=7)
                                       Output:["_col0","_col1"]
-                                      Group By Operator [GBY_215] (rows=1414922 width=3)
+                                      Group By Operator [GBY_215] (rows=505464 width=3)
                                         Output:["_col0"],keys:KEY._col0
                                       <-Reducer 16 [SIMPLE_EDGE]
                                         SHUFFLE [RS_35]
                                           PartitionCols:_col0
-                                          Group By Operator [GBY_34] (rows=143930993 width=3)
+                                          Group By Operator [GBY_34] (rows=505464 width=3)
                                             Output:["_col0"],keys:_col1
-                                            Merge Join Operator [MERGEJOIN_182] (rows=143930993 width=3)
+                                            Merge Join Operator [MERGEJOIN_182] (rows=51391963 width=3)
                                               Conds:RS_214._col0=RS_198._col0(Inner),Output:["_col1"]
                                             <-Map 14 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_198]
@@ -228,16 +228,16 @@ Stage-0
                                 <-Reducer 4 [SIMPLE_EDGE]
                                   SHUFFLE [RS_57]
                                     PartitionCols:_col0
-                                    Merge Join Operator [MERGEJOIN_184] (rows=525327388 width=272)
+                                    Merge Join Operator [MERGEJOIN_184] (rows=1463345 width=272)
                                       Conds:RS_54._col0=RS_55._col0(Left Semi),Output:["_col0","_col4","_col6","_col7","_col8","_col9","_col10"]
                                     <-Reducer 13 [SIMPLE_EDGE]
                                       SHUFFLE [RS_55]
                                         PartitionCols:_col0
-                                        Group By Operator [GBY_53] (rows=525327388 width=3)
+                                        Group By Operator [GBY_53] (rows=1516392 width=3)
                                           Output:["_col0"],keys:_col0
-                                          Select Operator [SEL_23] (rows=525327388 width=3)
+                                          Select Operator [SEL_23] (rows=187573258 width=3)
                                             Output:["_col0"]
-                                            Merge Join Operator [MERGEJOIN_181] (rows=525327388 width=3)
+                                            Merge Join Operator [MERGEJOIN_181] (rows=187573258 width=3)
                                               Conds:RS_209._col0=RS_196._col0(Inner),Output:["_col1"]
                                             <-Map 14 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_196]
@@ -301,16 +301,16 @@ Stage-0
                             <-Reducer 20 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_225]
                                 PartitionCols:_col1
-                                Select Operator [SEL_224] (rows=1401496 width=7)
+                                Select Operator [SEL_224] (rows=501891 width=7)
                                   Output:["_col0","_col1"]
-                                  Group By Operator [GBY_223] (rows=1401496 width=3)
+                                  Group By Operator [GBY_223] (rows=501891 width=3)
                                     Output:["_col0"],keys:KEY._col0
                                   <-Reducer 19 [SIMPLE_EDGE]
                                     SHUFFLE [RS_49]
                                       PartitionCols:_col0
-                                      Group By Operator [GBY_48] (rows=285115246 width=3)
+                                      Group By Operator [GBY_48] (rows=1003782 width=3)
                                         Output:["_col0"],keys:_col1
-                                        Merge Join Operator [MERGEJOIN_183] (rows=285115246 width=3)
+                                        Merge Join Operator [MERGEJOIN_183] (rows=101083527 width=3)
                                           Conds:RS_222._col0=RS_200._col0(Inner),Output:["_col1"]
                                         <-Map 14 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_200]
@@ -333,7 +333,7 @@ Stage-0
                                                       PARTITION_ONLY_SHUFFLE [RS_171]
                                                         Group By Operator [GBY_170] (rows=1 width=12)
                                                           Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                          Select Operator [SEL_169] (rows=1414922 width=4)
+                                                          Select Operator [SEL_169] (rows=505464 width=4)
                                                             Output:["_col0"]
                                                              Please refer to the previous Merge Join Operator [MERGEJOIN_185]
 
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query36.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query36.q.out
index 9b5dfbc..7e4ea98 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query36.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query36.q.out
@@ -108,11 +108,11 @@ Stage-0
                           <-Reducer 4 [SIMPLE_EDGE]
                             SHUFFLE [RS_23]
                               PartitionCols:_col0, _col1, _col2
-                              Group By Operator [GBY_22] (rows=2487780 width=414)
+                              Group By Operator [GBY_22] (rows=85680 width=414)
                                 Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col3)"],keys:_col0, _col1, 0L
-                                Select Operator [SEL_20] (rows=525329897 width=395)
+                                Select Operator [SEL_20] (rows=30601888 width=232)
                                   Output:["_col0","_col1","_col2","_col3"]
-                                  Merge Join Operator [MERGEJOIN_82] (rows=525329897 width=395)
+                                  Merge Join Operator [MERGEJOIN_82] (rows=30601888 width=232)
                                     Conds:RS_17._col1=RS_98._col0(Inner),Output:["_col3","_col4","_col8","_col9"]
                                   <-Map 11 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_98]
@@ -124,7 +124,7 @@ Stage-0
                                   <-Reducer 3 [SIMPLE_EDGE]
                                     SHUFFLE [RS_17]
                                       PartitionCols:_col1
-                                      Merge Join Operator [MERGEJOIN_81] (rows=525329897 width=217)
+                                      Merge Join Operator [MERGEJOIN_81] (rows=30601888 width=54)
                                         Conds:RS_14._col2=RS_96._col0(Inner),Output:["_col1","_col3","_col4"]
                                       <-Map 10 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_96]
@@ -138,7 +138,7 @@ Stage-0
                                       <-Reducer 2 [SIMPLE_EDGE]
                                         SHUFFLE [RS_14]
                                           PartitionCols:_col2
-                                          Merge Join Operator [MERGEJOIN_80] (rows=525329897 width=221)
+                                          Merge Join Operator [MERGEJOIN_80] (rows=187574154 width=203)
                                             Conds:RS_93._col0=RS_85._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_85]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query38.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query38.q.out
index b9641ab..a5a8df3 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query38.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query38.q.out
@@ -90,28 +90,28 @@ Stage-0
               Select Operator [SEL_226] (rows=1 width=8)
                 Filter Operator [FIL_225] (rows=1 width=8)
                   predicate:(_col3 = 3L)
-                  Select Operator [SEL_224] (rows=954376212 width=8)
+                  Select Operator [SEL_224] (rows=165330890 width=8)
                     Output:["_col3"]
-                    Group By Operator [GBY_223] (rows=954376212 width=282)
+                    Group By Operator [GBY_223] (rows=165330890 width=282)
                       Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                     <-Union 5 [SIMPLE_EDGE]
                       <-Reducer 12 [CONTAINS] vectorized
                         Reduce Output Operator [RS_240]
                           PartitionCols:_col0, _col1, _col2
-                          Group By Operator [GBY_239] (rows=954376212 width=282)
+                          Group By Operator [GBY_239] (rows=165330890 width=282)
                             Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                            Group By Operator [GBY_238] (rows=285117831 width=282)
+                            Group By Operator [GBY_238] (rows=49146883 width=282)
                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col1, _col0, _col2
-                              Select Operator [SEL_237] (rows=285117831 width=274)
+                              Select Operator [SEL_237] (rows=49146883 width=274)
                                 Output:["_col0","_col1","_col2"]
-                                Group By Operator [GBY_236] (rows=285117831 width=274)
+                                Group By Operator [GBY_236] (rows=49146883 width=274)
                                   Output:["_col0","_col1","_col2"],keys:KEY._col0, KEY._col1, KEY._col2
                                 <-Reducer 11 [SIMPLE_EDGE]
                                   SHUFFLE [RS_40]
                                     PartitionCols:_col0, _col1, _col2
-                                    Group By Operator [GBY_39] (rows=285117831 width=274)
+                                    Group By Operator [GBY_39] (rows=49146883 width=274)
                                       Output:["_col0","_col1","_col2"],keys:_col6, _col5, _col3
-                                      Merge Join Operator [MERGEJOIN_174] (rows=285117831 width=274)
+                                      Merge Join Operator [MERGEJOIN_174] (rows=49146883 width=274)
                                         Conds:RS_35._col1=RS_216._col0(Inner),Output:["_col3","_col5","_col6"]
                                       <-Map 18 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_216]
@@ -123,7 +123,7 @@ Stage-0
                                       <-Reducer 10 [SIMPLE_EDGE]
                                         SHUFFLE [RS_35]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_173] (rows=285117831 width=97)
+                                          Merge Join Operator [MERGEJOIN_173] (rows=49146883 width=97)
                                             Conds:RS_235._col0=RS_199._col0(Inner),Output:["_col1","_col3"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_199]
@@ -157,20 +157,20 @@ Stage-0
                       <-Reducer 16 [CONTAINS] vectorized
                         Reduce Output Operator [RS_250]
                           PartitionCols:_col0, _col1, _col2
-                          Group By Operator [GBY_249] (rows=954376212 width=282)
+                          Group By Operator [GBY_249] (rows=165330890 width=282)
                             Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                            Group By Operator [GBY_248] (rows=143930993 width=282)
+                            Group By Operator [GBY_248] (rows=24986582 width=282)
                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col1, _col0, _col2
-                              Select Operator [SEL_247] (rows=143930993 width=274)
+                              Select Operator [SEL_247] (rows=24986582 width=274)
                                 Output:["_col0","_col1","_col2"]
-                                Group By Operator [GBY_246] (rows=143930993 width=274)
+                                Group By Operator [GBY_246] (rows=24986582 width=274)
                                   Output:["_col0","_col1","_col2"],keys:KEY._col0, KEY._col1, KEY._col2
                                 <-Reducer 15 [SIMPLE_EDGE]
                                   SHUFFLE [RS_65]
                                     PartitionCols:_col0, _col1, _col2
-                                    Group By Operator [GBY_64] (rows=143930993 width=274)
+                                    Group By Operator [GBY_64] (rows=24986582 width=274)
                                       Output:["_col0","_col1","_col2"],keys:_col6, _col5, _col3
-                                      Merge Join Operator [MERGEJOIN_176] (rows=143930993 width=274)
+                                      Merge Join Operator [MERGEJOIN_176] (rows=24986582 width=274)
                                         Conds:RS_60._col1=RS_217._col0(Inner),Output:["_col3","_col5","_col6"]
                                       <-Map 18 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_217]
@@ -179,7 +179,7 @@ Stage-0
                                       <-Reducer 14 [SIMPLE_EDGE]
                                         SHUFFLE [RS_60]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_175] (rows=143930993 width=97)
+                                          Merge Join Operator [MERGEJOIN_175] (rows=24986582 width=97)
                                             Conds:RS_245._col0=RS_201._col0(Inner),Output:["_col1","_col3"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_201]
@@ -208,20 +208,20 @@ Stage-0
                       <-Reducer 4 [CONTAINS] vectorized
                         Reduce Output Operator [RS_222]
                           PartitionCols:_col0, _col1, _col2
-                          Group By Operator [GBY_221] (rows=954376212 width=282)
+                          Group By Operator [GBY_221] (rows=165330890 width=282)
                             Output:["_col0","_col1","_col2","_col3"],aggregations:["count(_col3)"],keys:_col0, _col1, _col2
-                            Group By Operator [GBY_220] (rows=525327388 width=282)
+                            Group By Operator [GBY_220] (rows=91197425 width=282)
                               Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col1, _col0, _col2
-                              Select Operator [SEL_219] (rows=525327388 width=274)
+                              Select Operator [SEL_219] (rows=91197425 width=274)
                                 Output:["_col0","_col1","_col2"]
-                                Group By Operator [GBY_218] (rows=525327388 width=274)
+                                Group By Operator [GBY_218] (rows=91197425 width=274)
                                   Output:["_col0","_col1","_col2"],keys:KEY._col0, KEY._col1, KEY._col2
                                 <-Reducer 3 [SIMPLE_EDGE]
                                   SHUFFLE [RS_16]
                                     PartitionCols:_col0, _col1, _col2
-                                    Group By Operator [GBY_15] (rows=525327388 width=274)
+                                    Group By Operator [GBY_15] (rows=91197425 width=274)
                                       Output:["_col0","_col1","_col2"],keys:_col6, _col5, _col3
-                                      Merge Join Operator [MERGEJOIN_172] (rows=525327388 width=274)
+                                      Merge Join Operator [MERGEJOIN_172] (rows=91197425 width=274)
                                         Conds:RS_11._col1=RS_215._col0(Inner),Output:["_col3","_col5","_col6"]
                                       <-Map 18 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_215]
@@ -230,7 +230,7 @@ Stage-0
                                       <-Reducer 2 [SIMPLE_EDGE]
                                         SHUFFLE [RS_11]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_171] (rows=525327388 width=97)
+                                          Merge Join Operator [MERGEJOIN_171] (rows=91197425 width=96)
                                             Conds:RS_213._col0=RS_197._col0(Inner),Output:["_col1","_col3"]
                                           <-Map 8 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_197]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
index 127bd87..5f5322c 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query4.q.out
@@ -274,17 +274,17 @@ Stage-0
       File Output Operator [FS_563]
         Limit [LIM_562] (rows=100 width=85)
           Number of rows:100
-          Select Operator [SEL_561] (rows=11399756 width=85)
+          Select Operator [SEL_561] (rows=7323197 width=85)
             Output:["_col0"]
           <-Reducer 9 [SIMPLE_EDGE]
             SHUFFLE [RS_135]
-              Select Operator [SEL_134] (rows=11399756 width=85)
+              Select Operator [SEL_134] (rows=7323197 width=85)
                 Output:["_col0"]
-                Top N Key Operator [TNK_250] (rows=11399756 width=537)
+                Top N Key Operator [TNK_250] (rows=7323197 width=537)
                   keys:_col13,top n:100
-                  Filter Operator [FIL_133] (rows=11399756 width=537)
+                  Filter Operator [FIL_133] (rows=7323197 width=537)
                     predicate:CASE WHEN (_col4 is not null) THEN (CASE WHEN (_col7) THEN (((_col9 / _col6) > (_col14 / _col4))) ELSE (false) END) ELSE (false) END
-                    Merge Join Operator [MERGEJOIN_467] (rows=22799512 width=537)
+                    Merge Join Operator [MERGEJOIN_467] (rows=14646395 width=537)
                       Conds:RS_130._col3=RS_560._col0(Inner),Output:["_col4","_col6","_col7","_col9","_col13","_col14"]
                     <-Reducer 30 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_560]
@@ -298,7 +298,7 @@ Stage-0
                               PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                               Group By Operator [GBY_113] (rows=80000000 width=764)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                Merge Join Operator [MERGEJOIN_462] (rows=525327388 width=764)
+                                Merge Join Operator [MERGEJOIN_462] (rows=187573258 width=764)
                                   Conds:RS_109._col1=RS_506._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                 <-Map 38 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_506]
@@ -310,7 +310,7 @@ Stage-0
                                 <-Reducer 28 [SIMPLE_EDGE]
                                   SHUFFLE [RS_109]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_461] (rows=525327388 width=115)
+                                    Merge Join Operator [MERGEJOIN_461] (rows=187573258 width=115)
                                       Conds:RS_557._col0=RS_476._col0(Inner),Output:["_col1","_col2"]
                                     <-Map 31 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_476]
@@ -344,23 +344,23 @@ Stage-0
                     <-Reducer 8 [SIMPLE_EDGE]
                       SHUFFLE [RS_130]
                         PartitionCols:_col3
-                        Filter Operator [FIL_129] (rows=19066162 width=668)
+                        Filter Operator [FIL_129] (rows=12248093 width=668)
                           predicate:CASE WHEN (_col2) THEN (CASE WHEN (_col7) THEN (((_col9 / _col6) > (_col11 / _col1))) ELSE (false) END) ELSE (false) END
-                          Merge Join Operator [MERGEJOIN_466] (rows=38132324 width=668)
+                          Merge Join Operator [MERGEJOIN_466] (rows=24496187 width=668)
                             Conds:RS_126._col3=RS_552._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7","_col9","_col11"]
                           <-Reducer 26 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_552]
                               PartitionCols:_col0
-                              Select Operator [SEL_551] (rows=80000000 width=212)
+                              Select Operator [SEL_551] (rows=51391963 width=212)
                                 Output:["_col0","_col1"]
-                                Group By Operator [GBY_550] (rows=80000000 width=764)
+                                Group By Operator [GBY_550] (rows=51391963 width=764)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
                                 <-Reducer 25 [SIMPLE_EDGE]
                                   SHUFFLE [RS_95]
                                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
-                                    Group By Operator [GBY_94] (rows=80000000 width=764)
+                                    Group By Operator [GBY_94] (rows=51391963 width=764)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                      Merge Join Operator [MERGEJOIN_460] (rows=143930993 width=764)
+                                      Merge Join Operator [MERGEJOIN_460] (rows=51391963 width=764)
                                         Conds:RS_90._col1=RS_507._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                       <-Map 38 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_507]
@@ -369,7 +369,7 @@ Stage-0
                                       <-Reducer 24 [SIMPLE_EDGE]
                                         SHUFFLE [RS_90]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_459] (rows=143930993 width=115)
+                                          Merge Join Operator [MERGEJOIN_459] (rows=51391963 width=115)
                                             Conds:RS_549._col0=RS_478._col0(Inner),Output:["_col1","_col2"]
                                           <-Map 31 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_478]
@@ -398,7 +398,7 @@ Stage-0
                           <-Reducer 7 [SIMPLE_EDGE]
                             SHUFFLE [RS_126]
                               PartitionCols:_col3
-                              Merge Join Operator [MERGEJOIN_465] (rows=31888273 width=556)
+                              Merge Join Operator [MERGEJOIN_465] (rows=20485012 width=556)
                                 Conds:RS_123._col3=RS_544._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7","_col9"]
                               <-Reducer 22 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_544]
@@ -412,7 +412,7 @@ Stage-0
                                         PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                                         Group By Operator [GBY_75] (rows=80000000 width=764)
                                           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                          Merge Join Operator [MERGEJOIN_458] (rows=285117831 width=764)
+                                          Merge Join Operator [MERGEJOIN_458] (rows=101084444 width=764)
                                             Conds:RS_71._col1=RS_508._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                           <-Map 38 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_508]
@@ -421,7 +421,7 @@ Stage-0
                                           <-Reducer 20 [SIMPLE_EDGE]
                                             SHUFFLE [RS_71]
                                               PartitionCols:_col1
-                                              Merge Join Operator [MERGEJOIN_457] (rows=285117831 width=115)
+                                              Merge Join Operator [MERGEJOIN_457] (rows=101084444 width=115)
                                                 Conds:RS_541._col0=RS_480._col0(Inner),Output:["_col1","_col2"]
                                               <-Map 31 [SIMPLE_EDGE] vectorized
                                                 PARTITION_ONLY_SHUFFLE [RS_480]
@@ -450,7 +450,7 @@ Stage-0
                               <-Reducer 6 [SIMPLE_EDGE]
                                 SHUFFLE [RS_123]
                                   PartitionCols:_col3
-                                  Merge Join Operator [MERGEJOIN_464] (rows=26666666 width=444)
+                                  Merge Join Operator [MERGEJOIN_464] (rows=17130654 width=444)
                                     Conds:RS_120._col3=RS_536._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7"]
                                   <-Reducer 18 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_536]
@@ -468,7 +468,7 @@ Stage-0
                                                 PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                                                 Group By Operator [GBY_55] (rows=80000000 width=764)
                                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                                  Merge Join Operator [MERGEJOIN_456] (rows=285117831 width=764)
+                                                  Merge Join Operator [MERGEJOIN_456] (rows=101084444 width=764)
                                                     Conds:RS_51._col1=RS_511._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                                   <-Map 38 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_511]
@@ -477,7 +477,7 @@ Stage-0
                                                   <-Reducer 16 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_51]
                                                       PartitionCols:_col1
-                                                      Merge Join Operator [MERGEJOIN_455] (rows=285117831 width=115)
+                                                      Merge Join Operator [MERGEJOIN_455] (rows=101084444 width=115)
                                                         Conds:RS_531._col0=RS_486._col0(Inner),Output:["_col1","_col2"]
                                                       <-Map 31 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_486]
@@ -510,7 +510,7 @@ Stage-0
                                   <-Reducer 5 [SIMPLE_EDGE]
                                     SHUFFLE [RS_120]
                                       PartitionCols:_col3
-                                      Merge Join Operator [MERGEJOIN_463] (rows=26666666 width=328)
+                                      Merge Join Operator [MERGEJOIN_463] (rows=17130654 width=328)
                                         Conds:RS_516._col0=RS_526._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                       <-Reducer 14 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_526]
@@ -528,7 +528,7 @@ Stage-0
                                                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
                                                     Group By Operator [GBY_35] (rows=80000000 width=764)
                                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                                      Merge Join Operator [MERGEJOIN_454] (rows=525327388 width=764)
+                                                      Merge Join Operator [MERGEJOIN_454] (rows=187573258 width=764)
                                                         Conds:RS_31._col1=RS_510._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                                       <-Map 38 [SIMPLE_EDGE] vectorized
                                                         SHUFFLE [RS_510]
@@ -537,7 +537,7 @@ Stage-0
                                                       <-Reducer 12 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_31]
                                                           PartitionCols:_col1
-                                                          Merge Join Operator [MERGEJOIN_453] (rows=525327388 width=115)
+                                                          Merge Join Operator [MERGEJOIN_453] (rows=187573258 width=115)
                                                             Conds:RS_521._col0=RS_484._col0(Inner),Output:["_col1","_col2"]
                                                           <-Map 31 [SIMPLE_EDGE] vectorized
                                                             PARTITION_ONLY_SHUFFLE [RS_484]
@@ -570,20 +570,20 @@ Stage-0
                                       <-Reducer 4 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_516]
                                           PartitionCols:_col0
-                                          Select Operator [SEL_515] (rows=26666666 width=216)
+                                          Select Operator [SEL_515] (rows=17130654 width=216)
                                             Output:["_col0","_col1","_col2"]
-                                            Filter Operator [FIL_514] (rows=26666666 width=212)
+                                            Filter Operator [FIL_514] (rows=17130654 width=212)
                                               predicate:(_col7 > 0)
-                                              Select Operator [SEL_513] (rows=80000000 width=212)
+                                              Select Operator [SEL_513] (rows=51391963 width=212)
                                                 Output:["_col0","_col7"]
-                                                Group By Operator [GBY_512] (rows=80000000 width=764)
+                                                Group By Operator [GBY_512] (rows=51391963 width=764)
                                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6
                                                 <-Reducer 3 [SIMPLE_EDGE]
                                                   SHUFFLE [RS_16]
                                                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6
-                                                    Group By Operator [GBY_15] (rows=80000000 width=764)
+                                                    Group By Operator [GBY_15] (rows=51391963 width=764)
                                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(_col2)"],keys:_col5, _col6, _col7, _col8, _col9, _col10, _col11
-                                                      Merge Join Operator [MERGEJOIN_452] (rows=143930993 width=764)
+                                                      Merge Join Operator [MERGEJOIN_452] (rows=51391963 width=764)
                                                         Conds:RS_11._col1=RS_509._col0(Inner),Output:["_col2","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                                       <-Map 38 [SIMPLE_EDGE] vectorized
                                                         SHUFFLE [RS_509]
@@ -592,7 +592,7 @@ Stage-0
                                                       <-Reducer 2 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_11]
                                                           PartitionCols:_col1
-                                                          Merge Join Operator [MERGEJOIN_451] (rows=143930993 width=115)
+                                                          Merge Join Operator [MERGEJOIN_451] (rows=51391963 width=115)
                                                             Conds:RS_504._col0=RS_482._col0(Inner),Output:["_col1","_col2"]
                                                           <-Map 31 [SIMPLE_EDGE] vectorized
                                                             PARTITION_ONLY_SHUFFLE [RS_482]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
index fc1f190..a44ad59 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query40.q.out
@@ -93,13 +93,13 @@ Stage-0
               <-Reducer 5 [SIMPLE_EDGE]
                 SHUFFLE [RS_28]
                   PartitionCols:_col0, _col1
-                  Group By Operator [GBY_27] (rows=51819042 width=410)
+                  Group By Operator [GBY_27] (rows=5757278 width=410)
                     Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)","sum(_col3)"],keys:_col0, _col1
-                    Select Operator [SEL_25] (rows=51819042 width=302)
+                    Select Operator [SEL_25] (rows=5757278 width=278)
                       Output:["_col0","_col1","_col2","_col3"]
-                      Top N Key Operator [TNK_56] (rows=51819042 width=302)
+                      Top N Key Operator [TNK_56] (rows=5757278 width=278)
                         keys:_col14, _col12,top n:100
-                        Merge Join Operator [MERGEJOIN_104] (rows=51819042 width=302)
+                        Merge Join Operator [MERGEJOIN_104] (rows=5757278 width=278)
                           Conds:RS_22._col1=RS_122._col0(Inner),Output:["_col4","_col7","_col9","_col10","_col12","_col14"]
                         <-Map 12 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_122]
@@ -111,7 +111,7 @@ Stage-0
                         <-Reducer 4 [SIMPLE_EDGE]
                           SHUFFLE [RS_22]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_103] (rows=51819042 width=220)
+                            Merge Join Operator [MERGEJOIN_103] (rows=5757278 width=195)
                               Conds:RS_19._col2=RS_107._col0(Inner),Output:["_col1","_col4","_col7","_col9","_col10","_col12"]
                             <-Map 10 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_107]
@@ -125,7 +125,7 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE]
                               SHUFFLE [RS_19]
                                 PartitionCols:_col2
-                                Merge Join Operator [MERGEJOIN_102] (rows=466374405 width=171)
+                                Merge Join Operator [MERGEJOIN_102] (rows=51815831 width=124)
                                   Conds:RS_16._col0=RS_120._col0(Inner),Output:["_col1","_col2","_col4","_col7","_col9","_col10"]
                                 <-Map 9 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_120]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
index b29b8e5..477f707 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query42.q.out
@@ -79,9 +79,9 @@ Stage-0
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_17]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_16] (rows=6840 width=206)
+                      Group By Operator [GBY_16] (rows=120 width=206)
                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col5, _col6
-                        Merge Join Operator [MERGEJOIN_55] (rows=84037218 width=173)
+                        Merge Join Operator [MERGEJOIN_55] (rows=2301098 width=94)
                           Conds:RS_12._col1=RS_69._col0(Inner),Output:["_col2","_col5","_col6"]
                         <-Map 8 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_69]
@@ -95,7 +95,7 @@ Stage-0
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_12]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_54] (rows=550076554 width=110)
+                            Merge Join Operator [MERGEJOIN_54] (rows=15062131 width=4)
                               Conds:RS_66._col0=RS_58._col0(Inner),Output:["_col1","_col2"]
                             <-Map 6 [SIMPLE_EDGE] vectorized
                               PARTITION_ONLY_SHUFFLE [RS_58]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out
index 487e294..78a2713 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query43.q.out
@@ -71,13 +71,13 @@ Stage-0
                 <-Reducer 3 [SIMPLE_EDGE]
                   SHUFFLE [RS_18]
                     PartitionCols:_col0, _col1
-                    Group By Operator [GBY_17] (rows=2486913 width=972)
+                    Group By Operator [GBY_17] (rows=142538 width=972)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col0, _col1
-                      Select Operator [SEL_15] (rows=525329897 width=322)
+                      Select Operator [SEL_15] (rows=37536846 width=257)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
-                        Top N Key Operator [TNK_36] (rows=525329897 width=322)
+                        Top N Key Operator [TNK_36] (rows=37536846 width=257)
                           keys:_col13, _col12,top n:100
-                          Merge Join Operator [MERGEJOIN_60] (rows=525329897 width=322)
+                          Merge Join Operator [MERGEJOIN_60] (rows=37536846 width=257)
                             Conds:RS_12._col1=RS_74._col0(Inner),Output:["_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col12","_col13"]
                           <-Map 8 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_74]
@@ -91,7 +91,7 @@ Stage-0
                           <-Reducer 2 [SIMPLE_EDGE]
                             SHUFFLE [RS_12]
                               PartitionCols:_col1
-                              Merge Join Operator [MERGEJOIN_59] (rows=525329897 width=138)
+                              Merge Join Operator [MERGEJOIN_59] (rows=187574154 width=129)
                                 Conds:RS_71._col0=RS_63._col0(Inner),Output:["_col1","_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
                               <-Map 6 [SIMPLE_EDGE] vectorized
                                 PARTITION_ONLY_SHUFFLE [RS_63]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
index 15953f9..51c1539 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query45.q.out
@@ -70,26 +70,26 @@ Stage-0
       File Output Operator [FS_154]
         Limit [LIM_153] (rows=100 width=299)
           Number of rows:100
-          Select Operator [SEL_152] (rows=17401956 width=299)
+          Select Operator [SEL_152] (rows=285780 width=299)
             Output:["_col0","_col1","_col2"]
           <-Reducer 4 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_151]
-              Group By Operator [GBY_150] (rows=17401956 width=299)
+              Group By Operator [GBY_150] (rows=285780 width=299)
                 Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
               <-Reducer 3 [SIMPLE_EDGE]
                 SHUFFLE [RS_41]
                   PartitionCols:_col0, _col1
-                  Group By Operator [GBY_40] (rows=143930993 width=299)
+                  Group By Operator [GBY_40] (rows=3715140 width=299)
                     Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col8, _col7
-                    Select Operator [SEL_39] (rows=143930993 width=302)
+                    Select Operator [SEL_39] (rows=10246864 width=302)
                       Output:["_col3","_col7","_col8"]
-                      Top N Key Operator [TNK_72] (rows=143930993 width=302)
+                      Top N Key Operator [TNK_72] (rows=10246864 width=302)
                         keys:_col8, _col7,top n:100
-                        Filter Operator [FIL_38] (rows=143930993 width=302)
+                        Filter Operator [FIL_38] (rows=10246864 width=302)
                           predicate:(_col15 is not null or (substr(_col8, 1, 5)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792'))
-                          Select Operator [SEL_37] (rows=143930993 width=302)
+                          Select Operator [SEL_37] (rows=10246864 width=302)
                             Output:["_col3","_col7","_col8","_col15"]
-                            Merge Join Operator [MERGEJOIN_124] (rows=143930993 width=302)
+                            Merge Join Operator [MERGEJOIN_124] (rows=10246864 width=302)
                               Conds:RS_34._col0=RS_35._col6(Inner),Output:["_col3","_col7","_col8","_col12"]
                             <-Reducer 2 [SIMPLE_EDGE]
                               SHUFFLE [RS_34]
@@ -123,12 +123,12 @@ Stage-0
                             <-Reducer 9 [SIMPLE_EDGE]
                               SHUFFLE [RS_35]
                                 PartitionCols:_col6
-                                Merge Join Operator [MERGEJOIN_123] (rows=143930993 width=302)
+                                Merge Join Operator [MERGEJOIN_123] (rows=10246864 width=302)
                                   Conds:RS_27._col0=RS_28._col2(Inner),Output:["_col3","_col4","_col6","_col8"]
                                 <-Reducer 12 [SIMPLE_EDGE]
                                   SHUFFLE [RS_28]
                                     PartitionCols:_col2
-                                    Merge Join Operator [MERGEJOIN_122] (rows=143930993 width=119)
+                                    Merge Join Operator [MERGEJOIN_122] (rows=10246864 width=119)
                                       Conds:RS_149._col0=RS_141._col0(Inner),Output:["_col1","_col2","_col3"]
                                     <-Map 13 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_141]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
index fcf414c..492e21b 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query46.q.out
@@ -102,17 +102,17 @@ Stage-0
       File Output Operator [FS_173]
         Limit [LIM_172] (rows=100 width=594)
           Number of rows:100
-          Select Operator [SEL_171] (rows=457565061 width=594)
+          Select Operator [SEL_171] (rows=8380115 width=594)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           <-Reducer 3 [SIMPLE_EDGE]
             SHUFFLE [RS_44]
-              Select Operator [SEL_43] (rows=457565061 width=594)
+              Select Operator [SEL_43] (rows=8380115 width=594)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                Top N Key Operator [TNK_78] (rows=457565061 width=594)
+                Top N Key Operator [TNK_78] (rows=8380115 width=594)
                   keys:_col3, _col2, _col5, _col8, _col6,top n:100
-                  Filter Operator [FIL_42] (rows=457565061 width=594)
+                  Filter Operator [FIL_42] (rows=8380115 width=594)
                     predicate:(_col5 <> _col8)
-                    Merge Join Operator [MERGEJOIN_144] (rows=457565061 width=594)
+                    Merge Join Operator [MERGEJOIN_144] (rows=8380115 width=594)
                       Conds:RS_39._col0=RS_170._col1(Inner),Output:["_col2","_col3","_col5","_col6","_col8","_col9","_col10"]
                     <-Reducer 2 [SIMPLE_EDGE]
                       SHUFFLE [RS_39]
@@ -138,16 +138,16 @@ Stage-0
                     <-Reducer 7 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_170]
                         PartitionCols:_col1
-                        Select Operator [SEL_169] (rows=457565061 width=324)
+                        Select Operator [SEL_169] (rows=8380115 width=321)
                           Output:["_col0","_col1","_col2","_col3","_col4"]
-                          Group By Operator [GBY_168] (rows=457565061 width=328)
+                          Group By Operator [GBY_168] (rows=8380115 width=321)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
                           <-Reducer 6 [SIMPLE_EDGE]
                             SHUFFLE [RS_33]
                               PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_32] (rows=457565061 width=328)
+                              Group By Operator [GBY_32] (rows=8380115 width=321)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col6)","sum(_col7)"],keys:_col1, _col12, _col3, _col5
-                                Merge Join Operator [MERGEJOIN_143] (rows=457565061 width=318)
+                                Merge Join Operator [MERGEJOIN_143] (rows=8380115 width=97)
                                   Conds:RS_28._col3=RS_150._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col12"]
                                 <-Map 5 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_150]
@@ -156,7 +156,7 @@ Stage-0
                                 <-Reducer 11 [SIMPLE_EDGE]
                                   SHUFFLE [RS_28]
                                     PartitionCols:_col3
-                                    Merge Join Operator [MERGEJOIN_142] (rows=457565061 width=225)
+                                    Merge Join Operator [MERGEJOIN_142] (rows=8380115 width=4)
                                       Conds:RS_25._col2=RS_167._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7"]
                                     <-Map 15 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_167]
@@ -170,7 +170,7 @@ Stage-0
                                     <-Reducer 10 [SIMPLE_EDGE]
                                       SHUFFLE [RS_25]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_141] (rows=457565061 width=229)
+                                        Merge Join Operator [MERGEJOIN_141] (rows=32526589 width=90)
                                           Conds:RS_22._col4=RS_164._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7"]
                                         <-Map 14 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_164]
@@ -184,7 +184,7 @@ Stage-0
                                         <-Reducer 9 [SIMPLE_EDGE]
                                           SHUFFLE [RS_22]
                                             PartitionCols:_col4
-                                            Merge Join Operator [MERGEJOIN_140] (rows=457565061 width=233)
+                                            Merge Join Operator [MERGEJOIN_140] (rows=196204013 width=218)
                                               Conds:RS_161._col0=RS_153._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                                             <-Map 12 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_153]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
index 97ac79b..b444bbc 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query47.q.out
@@ -161,9 +161,9 @@ Stage-0
                                 <-Reducer 4 [SIMPLE_EDGE]
                                   SHUFFLE [RS_93]
                                     PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                    Group By Operator [GBY_92] (rows=525329897 width=489)
+                                    Group By Operator [GBY_92] (rows=162257387 width=489)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col8, _col9, _col11, _col12
-                                      Merge Join Operator [MERGEJOIN_277] (rows=525329897 width=483)
+                                      Merge Join Operator [MERGEJOIN_277] (rows=162257387 width=472)
                                         Conds:RS_88._col1=RS_296._col0(Inner),Output:["_col3","_col5","_col6","_col8","_col9","_col11","_col12"]
                                       <-Map 15 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_296]
@@ -177,7 +177,7 @@ Stage-0
                                       <-Reducer 3 [SIMPLE_EDGE]
                                         SHUFFLE [RS_88]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_276] (rows=525329897 width=297)
+                                          Merge Join Operator [MERGEJOIN_276] (rows=162257387 width=286)
                                             Conds:RS_85._col2=RS_293._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col8","_col9"]
                                           <-Map 14 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_293]
@@ -191,7 +191,7 @@ Stage-0
                                           <-Reducer 2 [SIMPLE_EDGE]
                                             SHUFFLE [RS_85]
                                               PartitionCols:_col2
-                                              Merge Join Operator [MERGEJOIN_275] (rows=525329897 width=122)
+                                              Merge Join Operator [MERGEJOIN_275] (rows=162257387 width=111)
                                                 Conds:RS_290._col0=RS_282._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6"]
                                               <-Map 12 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_282]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
index 7cff382..9d3505f 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query48.q.out
@@ -162,11 +162,11 @@ Stage-0
           PARTITION_ONLY_SHUFFLE [RS_24]
             Group By Operator [GBY_23] (rows=1 width=8)
               Output:["_col0"],aggregations:["sum(_col3)"]
-              Select Operator [SEL_22] (rows=6953964 width=24)
+              Select Operator [SEL_22] (rows=170127 width=24)
                 Output:["_col3"]
-                Filter Operator [FIL_21] (rows=6953964 width=24)
+                Filter Operator [FIL_21] (rows=170127 width=24)
                   predicate:((_col10 and _col4) or (_col11 and _col5) or (_col12 and _col6))
-                  Merge Join Operator [MERGEJOIN_73] (rows=9271954 width=24)
+                  Merge Join Operator [MERGEJOIN_73] (rows=226838 width=24)
                     Conds:RS_18._col2=RS_90._col0(Inner),Output:["_col3","_col4","_col5","_col6","_col10","_col11","_col12"]
                   <-Map 9 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_90]
@@ -180,7 +180,7 @@ Stage-0
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_18]
                       PartitionCols:_col2
-                      Merge Join Operator [MERGEJOIN_72] (rows=9271954 width=13)
+                      Merge Join Operator [MERGEJOIN_72] (rows=2570826 width=12)
                         Conds:RS_15._col1=RS_87._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
                       <-Map 8 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_87]
@@ -194,7 +194,7 @@ Stage-0
                       <-Reducer 2 [SIMPLE_EDGE]
                         SHUFFLE [RS_15]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_71] (rows=159705894 width=23)
+                          Merge Join Operator [MERGEJOIN_71] (rows=57024544 width=22)
                             Conds:RS_84._col0=RS_76._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6"]
                           <-Map 6 [SIMPLE_EDGE] vectorized
                             PARTITION_ONLY_SHUFFLE [RS_76]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out
index 37fc516..32b932d 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query49.q.out
@@ -302,52 +302,52 @@ Stage-0
       File Output Operator [FS_315]
         Limit [LIM_314] (rows=100 width=215)
           Number of rows:100
-          Select Operator [SEL_313] (rows=40436 width=215)
+          Select Operator [SEL_313] (rows=3418 width=215)
             Output:["_col0","_col1","_col2","_col3","_col4"]
           <-Reducer 10 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_312]
-              Select Operator [SEL_311] (rows=40436 width=215)
+              Select Operator [SEL_311] (rows=3418 width=215)
                 Output:["_col0","_col1","_col2","_col3","_col4"]
-                Group By Operator [GBY_310] (rows=40436 width=215)
+                Group By Operator [GBY_310] (rows=3418 width=215)
                   Output:["_col0","_col1","_col2","_col3","_col4"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                 <-Union 9 [SIMPLE_EDGE]
                   <-Reducer 24 [CONTAINS] vectorized
                     Reduce Output Operator [RS_356]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_355] (rows=40436 width=215)
+                      Group By Operator [GBY_355] (rows=3418 width=215)
                         Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2
-                        Top N Key Operator [TNK_354] (rows=40436 width=214)
+                        Top N Key Operator [TNK_354] (rows=3418 width=214)
                           keys:_col0, _col3, _col4, _col1, _col2,top n:100
-                          Select Operator [SEL_353] (rows=14232 width=213)
+                          Select Operator [SEL_353] (rows=1142 width=213)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Filter Operator [FIL_352] (rows=14232 width=248)
+                            Filter Operator [FIL_352] (rows=1142 width=248)
                               predicate:((_col0 <= 10) or (rank_window_1 <= 10))
-                              PTF Operator [PTF_351] (rows=21349 width=248)
+                              PTF Operator [PTF_351] (rows=1714 width=248)
                                 Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                Select Operator [SEL_350] (rows=21349 width=248)
+                                Select Operator [SEL_350] (rows=1714 width=248)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                 <-Reducer 23 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_349]
                                     PartitionCols:0
-                                    Select Operator [SEL_348] (rows=21349 width=244)
+                                    Select Operator [SEL_348] (rows=1714 width=244)
                                       Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"]
-                                      PTF Operator [PTF_347] (rows=21349 width=244)
+                                      PTF Operator [PTF_347] (rows=1714 width=244)
                                         Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                        Select Operator [SEL_346] (rows=21349 width=244)
+                                        Select Operator [SEL_346] (rows=1714 width=244)
                                           Output:["_col0","_col1","_col2","_col3","_col4"]
                                         <-Reducer 22 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_345]
                                             PartitionCols:0
-                                            Group By Operator [GBY_344] (rows=21349 width=244)
+                                            Group By Operator [GBY_344] (rows=1714 width=244)
                                               Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0
                                             <-Reducer 21 [SIMPLE_EDGE]
                                               SHUFFLE [RS_89]
                                                 PartitionCols:_col0
-                                                Group By Operator [GBY_88] (rows=384282 width=244)
+                                                Group By Operator [GBY_88] (rows=1714 width=244)
                                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0
-                                                  Select Operator [SEL_86] (rows=20856667 width=216)
+                                                  Select Operator [SEL_86] (rows=1673571 width=73)
                                                     Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                    Merge Join Operator [MERGEJOIN_242] (rows=20856667 width=216)
+                                                    Merge Join Operator [MERGEJOIN_242] (rows=1673571 width=73)
                                                       Conds:RS_83._col1, _col2=RS_343._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"]
                                                     <-Map 30 [SIMPLE_EDGE] vectorized
                                                       SHUFFLE [RS_343]
@@ -361,7 +361,7 @@ Stage-0
                                                     <-Reducer 20 [SIMPLE_EDGE]
                                                       SHUFFLE [RS_83]
                                                         PartitionCols:_col1, _col2
-                                                        Merge Join Operator [MERGEJOIN_241] (rows=61119617 width=118)
+                                                        Merge Join Operator [MERGEJOIN_241] (rows=1673571 width=8)
                                                           Conds:RS_340._col0=RS_277._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                         <-Map 12 [SIMPLE_EDGE] vectorized
                                                           PARTITION_ONLY_SHUFFLE [RS_277]
@@ -395,50 +395,50 @@ Stage-0
                   <-Reducer 8 [CONTAINS] vectorized
                     Reduce Output Operator [RS_309]
                       PartitionCols:_col0, _col1, _col2, _col3, _col4
-                      Group By Operator [GBY_308] (rows=40436 width=215)
+                      Group By Operator [GBY_308] (rows=3418 width=215)
                         Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2
-                        Top N Key Operator [TNK_307] (rows=40436 width=214)
+                        Top N Key Operator [TNK_307] (rows=3418 width=214)
                           keys:_col0, _col3, _col4, _col1, _col2,top n:100
-                          Select Operator [SEL_306] (rows=26204 width=215)
+                          Select Operator [SEL_306] (rows=2276 width=215)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Group By Operator [GBY_305] (rows=26204 width=215)
+                            Group By Operator [GBY_305] (rows=2276 width=215)
                               Output:["_col0","_col1","_col2","_col3","_col4"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                             <-Union 7 [SIMPLE_EDGE]
                               <-Reducer 18 [CONTAINS] vectorized
                                 Reduce Output Operator [RS_335]
                                   PartitionCols:_col0, _col1, _col2, _col3, _col4
-                                  Group By Operator [GBY_334] (rows=26204 width=215)
+                                  Group By Operator [GBY_334] (rows=2276 width=215)
                                     Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2
-                                    Select Operator [SEL_333] (rows=12574 width=215)
+                                    Select Operator [SEL_333] (rows=1134 width=215)
                                       Output:["_col0","_col1","_col2","_col3","_col4"]
-                                      Filter Operator [FIL_332] (rows=12574 width=248)
+                                      Filter Operator [FIL_332] (rows=1134 width=248)
                                         predicate:((_col0 <= 10) or (rank_window_1 <= 10))
-                                        PTF Operator [PTF_331] (rows=18863 width=248)
+                                        PTF Operator [PTF_331] (rows=1701 width=248)
                                           Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                          Select Operator [SEL_330] (rows=18863 width=248)
+                                          Select Operator [SEL_330] (rows=1701 width=248)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                           <-Reducer 17 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_329]
                                               PartitionCols:0
-                                              Select Operator [SEL_328] (rows=18863 width=244)
+                                              Select Operator [SEL_328] (rows=1701 width=244)
                                                 Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"]
-                                                PTF Operator [PTF_327] (rows=18863 width=244)
+                                                PTF Operator [PTF_327] (rows=1701 width=244)
                                                   Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                                  Select Operator [SEL_326] (rows=18863 width=244)
+                                                  Select Operator [SEL_326] (rows=1701 width=244)
                                                     Output:["_col0","_col1","_col2","_col3","_col4"]
                                                   <-Reducer 16 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_325]
                                                       PartitionCols:0
-                                                      Group By Operator [GBY_324] (rows=18863 width=244)
+                                                      Group By Operator [GBY_324] (rows=1701 width=244)
                                                         Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0
                                                       <-Reducer 15 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_50]
                                                           PartitionCols:_col0
-                                                          Group By Operator [GBY_49] (rows=169767 width=244)
+                                                          Group By Operator [GBY_49] (rows=1701 width=244)
                                                             Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0
-                                                            Select Operator [SEL_47] (rows=9599627 width=231)
+                                                            Select Operator [SEL_47] (rows=865646 width=188)
                                                               Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                              Merge Join Operator [MERGEJOIN_240] (rows=9599627 width=231)
+                                                              Merge Join Operator [MERGEJOIN_240] (rows=865646 width=188)
                                                                 Conds:RS_44._col1, _col2=RS_323._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"]
                                                               <-Map 28 [SIMPLE_EDGE] vectorized
                                                                 SHUFFLE [RS_323]
@@ -452,7 +452,7 @@ Stage-0
                                                               <-Reducer 14 [SIMPLE_EDGE]
                                                                 SHUFFLE [RS_44]
                                                                   PartitionCols:_col1, _col2
-                                                                  Merge Join Operator [MERGEJOIN_239] (rows=31838858 width=123)
+                                                                  Merge Join Operator [MERGEJOIN_239] (rows=865646 width=102)
                                                                     Conds:RS_320._col0=RS_275._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                                   <-Map 12 [SIMPLE_EDGE] vectorized
                                                                     PARTITION_ONLY_SHUFFLE [RS_275]
@@ -481,38 +481,38 @@ Stage-0
                               <-Reducer 6 [CONTAINS] vectorized
                                 Reduce Output Operator [RS_304]
                                   PartitionCols:_col0, _col1, _col2, _col3, _col4
-                                  Group By Operator [GBY_303] (rows=26204 width=215)
+                                  Group By Operator [GBY_303] (rows=2276 width=215)
                                     Output:["_col0","_col1","_col2","_col3","_col4"],keys:_col0, _col3, _col4, _col1, _col2
-                                    Select Operator [SEL_302] (rows=13630 width=211)
+                                    Select Operator [SEL_302] (rows=1142 width=211)
                                       Output:["_col0","_col1","_col2","_col3","_col4"]
-                                      Filter Operator [FIL_301] (rows=13630 width=248)
+                                      Filter Operator [FIL_301] (rows=1142 width=248)
                                         predicate:((_col0 <= 10) or (rank_window_1 <= 10))
-                                        PTF Operator [PTF_300] (rows=20445 width=248)
+                                        PTF Operator [PTF_300] (rows=1714 width=248)
                                           Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                          Select Operator [SEL_299] (rows=20445 width=248)
+                                          Select Operator [SEL_299] (rows=1714 width=248)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_298]
                                               PartitionCols:0
-                                              Select Operator [SEL_297] (rows=20445 width=244)
+                                              Select Operator [SEL_297] (rows=1714 width=244)
                                                 Output:["rank_window_0","_col0","_col1","_col2","_col3","_col4"]
-                                                PTF Operator [PTF_296] (rows=20445 width=244)
+                                                PTF Operator [PTF_296] (rows=1714 width=244)
                                                   Function definitions:[{},{"name:":"windowingtablefunction","order by:":"(CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST","partition by:":"0"}]
-                                                  Select Operator [SEL_295] (rows=20445 width=244)
+                                                  Select Operator [SEL_295] (rows=1714 width=244)
                                                     Output:["_col0","_col1","_col2","_col3","_col4"]
                                                   <-Reducer 4 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_294]
                                                       PartitionCols:0
-                                                      Group By Operator [GBY_293] (rows=20445 width=244)
+                                                      Group By Operator [GBY_293] (rows=1714 width=244)
                                                         Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0
                                                       <-Reducer 3 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_18]
                                                           PartitionCols:_col0
-                                                          Group By Operator [GBY_17] (rows=102225 width=244)
+                                                          Group By Operator [GBY_17] (rows=1714 width=244)
                                                             Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0
-                                                            Select Operator [SEL_15] (rows=5227456 width=231)
+                                                            Select Operator [SEL_15] (rows=438010 width=177)
                                                               Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                              Merge Join Operator [MERGEJOIN_238] (rows=5227456 width=231)
+                                                              Merge Join Operator [MERGEJOIN_238] (rows=438010 width=177)
                                                                 Conds:RS_12._col1, _col2=RS_292._col0, _col1(Inner),Output:["_col1","_col3","_col4","_col9","_col10"]
                                                               <-Map 26 [SIMPLE_EDGE] vectorized
                                                                 SHUFFLE [RS_292]
@@ -526,7 +526,7 @@ Stage-0
                                                               <-Reducer 2 [SIMPLE_EDGE]
                                                                 SHUFFLE [RS_12]
                                                                   PartitionCols:_col1, _col2
-                                                                  Merge Join Operator [MERGEJOIN_237] (rows=15996318 width=123)
+                                                                  Merge Join Operator [MERGEJOIN_237] (rows=438010 width=122)
                                                                     Conds:RS_289._col0=RS_273._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                                   <-Map 12 [SIMPLE_EDGE] vectorized
                                                                     PARTITION_ONLY_SHUFFLE [RS_273]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out
index 6f2bb83..a5870f7 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query5.q.out
@@ -329,9 +329,9 @@ Stage-0
                             <-Reducer 13 [SIMPLE_EDGE]
                               SHUFFLE [RS_45]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_44] (rows=26026820 width=548)
+                                Group By Operator [GBY_44] (rows=2835758 width=548)
                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8
-                                  Merge Join Operator [MERGEJOIN_224] (rows=313339499 width=546)
+                                  Merge Join Operator [MERGEJOIN_224] (rows=34813117 width=535)
                                     Conds:RS_40._col0=RS_310._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"]
                                   <-Map 24 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_310]
@@ -343,7 +343,7 @@ Stage-0
                                   <-Reducer 12 [SIMPLE_EDGE]
                                     SHUFFLE [RS_40]
                                       PartitionCols:_col0
-                                      Merge Join Operator [MERGEJOIN_223] (rows=313339499 width=450)
+                                      Merge Join Operator [MERGEJOIN_223] (rows=34813117 width=438)
                                         Conds:Union 22._col1=RS_278._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"]
                                       <-Map 10 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_278]
@@ -398,9 +398,9 @@ Stage-0
                             <-Reducer 17 [SIMPLE_EDGE]
                               SHUFFLE [RS_77]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_76] (rows=31641 width=548)
+                                Group By Operator [GBY_76] (rows=3498 width=548)
                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8
-                                  Merge Join Operator [MERGEJOIN_226] (rows=278713608 width=547)
+                                  Merge Join Operator [MERGEJOIN_226] (rows=30966059 width=543)
                                     Conds:RS_72._col0=RS_317._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"]
                                   <-Map 30 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_317]
@@ -412,7 +412,7 @@ Stage-0
                                   <-Reducer 16 [SIMPLE_EDGE]
                                     SHUFFLE [RS_72]
                                       PartitionCols:_col0
-                                      Merge Join Operator [MERGEJOIN_225] (rows=278713608 width=451)
+                                      Merge Join Operator [MERGEJOIN_225] (rows=30966059 width=447)
                                         Conds:Union 26._col1=RS_280._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"]
                                       <-Map 10 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_280]
@@ -478,9 +478,9 @@ Stage-0
                             <-Reducer 4 [SIMPLE_EDGE]
                               SHUFFLE [RS_21]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_20] (rows=983934 width=548)
+                                Group By Operator [GBY_20] (rows=78090 width=548)
                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col2)","sum(_col4)","sum(_col3)","sum(_col5)"],keys:_col8
-                                  Merge Join Operator [MERGEJOIN_222] (rows=578964757 width=528)
+                                  Merge Join Operator [MERGEJOIN_222] (rows=64325014 width=376)
                                     Conds:RS_16._col0=RS_294._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8"]
                                   <-Map 20 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_294]
@@ -492,7 +492,7 @@ Stage-0
                                   <-Reducer 3 [SIMPLE_EDGE]
                                     SHUFFLE [RS_16]
                                       PartitionCols:_col0
-                                      Merge Join Operator [MERGEJOIN_221] (rows=578964757 width=432)
+                                      Merge Join Operator [MERGEJOIN_221] (rows=64325014 width=277)
                                         Conds:Union 2._col1=RS_276._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"]
                                       <-Map 10 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_276]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out
index db09f6b..7d0ffc7 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query50.q.out
@@ -127,62 +127,55 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
-Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Map 9 <- Reducer 7 (BROADCAST_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 3 <- Map 9 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
 Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
       Reducer 6 vectorized
-      File Output Operator [FS_117]
-        Limit [LIM_116] (rows=100 width=858)
+      File Output Operator [FS_119]
+        Limit [LIM_118] (rows=100 width=858)
           Number of rows:100
-          Select Operator [SEL_115] (rows=478292911 width=857)
+          Select Operator [SEL_117] (rows=11945216 width=857)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
           <-Reducer 5 [SIMPLE_EDGE] vectorized
-            SHUFFLE [RS_114]
-              Group By Operator [GBY_113] (rows=478292911 width=857)
+            SHUFFLE [RS_116]
+              Group By Operator [GBY_115] (rows=11945216 width=857)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7, KEY._col8, KEY._col9
               <-Reducer 4 [SIMPLE_EDGE]
                 SHUFFLE [RS_23]
                   PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9
-                  Group By Operator [GBY_22] (rows=478292911 width=857)
+                  Group By Operator [GBY_22] (rows=11945216 width=857)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"],aggregations:["sum(_col10)","sum(_col11)","sum(_col12)","sum(_col13)","sum(_col14)"],keys:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9
-                    Select Operator [SEL_20] (rows=478292911 width=825)
+                    Select Operator [SEL_20] (rows=11945216 width=821)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
-                      Top N Key Operator [TNK_46] (rows=478292911 width=825)
+                      Top N Key Operator [TNK_46] (rows=11945216 width=821)
                         keys:_col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20,top n:100
-                        Merge Join Operator [MERGEJOIN_101] (rows=478292911 width=825)
-                          Conds:RS_17._col8=RS_112._col0(Inner),Output:["_col0","_col5","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20"]
-                        <-Map 9 [SIMPLE_EDGE] vectorized
-                          SHUFFLE [RS_112]
+                        Merge Join Operator [MERGEJOIN_101] (rows=11945216 width=821)
+                          Conds:RS_17._col8=RS_114._col0(Inner),Output:["_col0","_col5","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20"]
+                        <-Map 10 [SIMPLE_EDGE] vectorized
+                          SHUFFLE [RS_114]
                             PartitionCols:_col0
-                            Select Operator [SEL_111] (rows=1704 width=821)
+                            Select Operator [SEL_113] (rows=1704 width=821)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
                               TableScan [TS_9] (rows=1704 width=821)
                                 default@store,store,Tbl:COMPLETE,Col:COMPLETE,Output:["s_store_sk","s_store_name","s_company_id","s_street_number","s_street_name","s_street_type","s_suite_number","s_city","s_county","s_state","s_zip"]
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_17]
                             PartitionCols:_col8
-                            Merge Join Operator [MERGEJOIN_100] (rows=478292911 width=11)
-                              Conds:RS_14._col1, _col2, _col3=RS_110._col1, _col2, _col4(Inner),Output:["_col0","_col5","_col8"]
-                            <-Map 8 [SIMPLE_EDGE] vectorized
-                              SHUFFLE [RS_110]
-                                PartitionCols:_col1, _col2, _col4
-                                Select Operator [SEL_109] (rows=501694138 width=19)
-                                  Output:["_col0","_col1","_col2","_col3","_col4"]
-                                  Filter Operator [FIL_108] (rows=501694138 width=19)
-                                    predicate:(ss_sold_date_sk is not null and ss_customer_sk is not null and ss_store_sk is not null)
-                                    TableScan [TS_6] (rows=575995635 width=19)
-                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number"]
+                            Merge Join Operator [MERGEJOIN_100] (rows=11945216 width=3)
+                              Conds:RS_14._col1, _col2, _col3=RS_112._col1, _col2, _col4(Inner),Output:["_col0","_col5","_col8"]
                             <-Reducer 2 [SIMPLE_EDGE]
-                              SHUFFLE [RS_14]
+                              PARTITION_ONLY_SHUFFLE [RS_14]
                                 PartitionCols:_col1, _col2, _col3
-                                Merge Join Operator [MERGEJOIN_99] (rows=53632139 width=15)
+                                Merge Join Operator [MERGEJOIN_99] (rows=1339446 width=8)
                                   Conds:RS_104._col0=RS_107._col0(Inner),Output:["_col0","_col1","_col2","_col3"]
                                 <-Map 1 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_104]
@@ -193,7 +186,7 @@ Stage-0
                                         predicate:(sr_customer_sk is not null and sr_returned_date_sk is not null)
                                         TableScan [TS_0] (rows=57591150 width=15)
                                           default@store_returns,store_returns,Tbl:COMPLETE,Col:COMPLETE,Output:["sr_returned_date_sk","sr_item_sk","sr_customer_sk","sr_ticket_number"]
-                                <-Map 7 [SIMPLE_EDGE] vectorized
+                                <-Map 8 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_107]
                                     PartitionCols:_col0
                                     Select Operator [SEL_106] (rows=50 width=4)
@@ -202,4 +195,24 @@ Stage-0
                                         predicate:((d_year = 2000) and (d_moy = 9))
                                         TableScan [TS_3] (rows=73049 width=12)
                                           default@date_dim,d2,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                            <-Map 9 [SIMPLE_EDGE] vectorized
+                              SHUFFLE [RS_112]
+                                PartitionCols:_col1, _col2, _col4
+                                Select Operator [SEL_111] (rows=501694138 width=19)
+                                  Output:["_col0","_col1","_col2","_col3","_col4"]
+                                  Filter Operator [FIL_110] (rows=501694138 width=19)
+                                    predicate:(ss_sold_date_sk is not null and ss_customer_sk is not null and ss_store_sk is not null and ss_ticket_number BETWEEN DynamicValue(RS_14_store_returns_sr_ticket_number_min) AND DynamicValue(RS_14_store_returns_sr_ticket_number_max) and in_bloom_filter(ss_ticket_number, DynamicValue(RS_14_store_returns_sr_ticket_number_bloom_filter)))
+                                    TableScan [TS_6] (rows=575995635 width=19)
+                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk","ss_store_sk","ss_ticket_number"]
+                                    <-Reducer 7 [BROADCAST_EDGE] vectorized
+                                      BROADCAST [RS_109]
+                                        Group By Operator [GBY_108] (rows=1 width=12)
+                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                        <-Reducer 2 [CUSTOM_SIMPLE_EDGE]
+                                          PARTITION_ONLY_SHUFFLE [RS_86]
+                                            Group By Operator [GBY_85] (rows=1 width=12)
+                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                              Select Operator [SEL_84] (rows=1339446 width=8)
+                                                Output:["_col0"]
+                                                 Please refer to the previous Merge Join Operator [MERGEJOIN_99]
 
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query51.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query51.q.out
index fdfb8b3..257cb58 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query51.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query51.q.out
@@ -117,40 +117,40 @@ Stage-0
       File Output Operator [FS_117]
         Limit [LIM_116] (rows=100 width=636)
           Number of rows:100
-          Select Operator [SEL_115] (rows=2095597606 width=636)
+          Select Operator [SEL_115] (rows=363803676 width=636)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 5 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_114]
-              Select Operator [SEL_113] (rows=2095597606 width=636)
+              Select Operator [SEL_113] (rows=363803676 width=636)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                Top N Key Operator [TNK_112] (rows=2095597606 width=420)
+                Top N Key Operator [TNK_112] (rows=363803676 width=420)
                   keys:CASE WHEN (_col3 is not null) THEN (_col3) ELSE (_col0) END, CASE WHEN (_col4 is not null) THEN (_col4) ELSE (_col1) END,top n:100
-                  Filter Operator [FIL_111] (rows=2095597606 width=420)
+                  Filter Operator [FIL_111] (rows=363803676 width=420)
                     predicate:(max_window_0 > max_window_1)
-                    PTF Operator [PTF_110] (rows=6286792818 width=420)
+                    PTF Operator [PTF_110] (rows=1091411029 width=420)
                       Function definitions:[{},{"name:":"windowingtablefunction","order by:":"CASE WHEN (_col4 is not null) THEN (_col4) ELSE (_col1) END ASC NULLS LAST","partition by:":"CASE WHEN (_col3 is not null) THEN (_col3) ELSE (_col0) END"}]
-                      Select Operator [SEL_109] (rows=6286792818 width=420)
+                      Select Operator [SEL_109] (rows=1091411029 width=420)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                       <-Reducer 4 [SIMPLE_EDGE]
                         SHUFFLE [RS_41]
                           PartitionCols:CASE WHEN (_col3 is not null) THEN (_col3) ELSE (_col0) END
-                          Merge Join Operator [MERGEJOIN_86] (rows=6286792818 width=420)
+                          Merge Join Operator [MERGEJOIN_86] (rows=1091411029 width=420)
                             Conds:RS_38._col0, _col1=RS_39._col0, _col1(Outer),Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                           <-Reducer 10 [SIMPLE_EDGE]
                             SHUFFLE [RS_39]
                               PartitionCols:_col0, _col1
-                              Select Operator [SEL_36] (rows=19832154 width=210)
+                              Select Operator [SEL_36] (rows=3442937 width=210)
                                 Output:["_col0","_col1","_col2"]
-                                PTF Operator [PTF_35] (rows=19832154 width=210)
+                                PTF Operator [PTF_35] (rows=3442937 width=210)
                                   Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS LAST","partition by:":"_col0"}]
-                                  Group By Operator [GBY_31] (rows=19832154 width=210)
+                                  Group By Operator [GBY_31] (rows=3442937 width=210)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                   <-Reducer 9 [SIMPLE_EDGE]
                                     SHUFFLE [RS_30]
                                       PartitionCols:_col0
-                                      Group By Operator [GBY_29] (rows=143966864 width=210)
+                                      Group By Operator [GBY_29] (rows=24992810 width=210)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col1, _col4
-                                        Merge Join Operator [MERGEJOIN_85] (rows=143966864 width=209)
+                                        Merge Join Operator [MERGEJOIN_85] (rows=24992810 width=209)
                                           Conds:RS_107._col0=RS_91._col0(Inner),Output:["_col1","_col2","_col4"]
                                         <-Map 7 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_91]
@@ -184,18 +184,18 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_38]
                               PartitionCols:_col0, _col1
-                              Select Operator [SEL_17] (rows=19832154 width=210)
+                              Select Operator [SEL_17] (rows=3442937 width=210)
                                 Output:["_col0","_col1","_col2"]
-                                PTF Operator [PTF_16] (rows=19832154 width=210)
+                                PTF Operator [PTF_16] (rows=3442937 width=210)
                                   Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS LAST","partition by:":"_col0"}]
-                                  Group By Operator [GBY_12] (rows=19832154 width=210)
+                                  Group By Operator [GBY_12] (rows=3442937 width=210)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_11]
                                       PartitionCols:_col0
-                                      Group By Operator [GBY_10] (rows=550076554 width=210)
+                                      Group By Operator [GBY_10] (rows=95493908 width=210)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col1, _col4
-                                        Merge Join Operator [MERGEJOIN_84] (rows=550076554 width=204)
+                                        Merge Join Operator [MERGEJOIN_84] (rows=95493908 width=180)
                                           Conds:RS_101._col0=RS_89._col0(Inner),Output:["_col1","_col2","_col4"]
                                         <-Map 7 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_89]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query52.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query52.q.out
index 2c09c7b..bdb8750 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query52.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query52.q.out
@@ -81,7 +81,7 @@ Stage-0
                       PartitionCols:_col0, _col1
                       Group By Operator [GBY_16] (rows=7333 width=216)
                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col5, _col6
-                        Merge Join Operator [MERGEJOIN_55] (rows=84037218 width=183)
+                        Merge Join Operator [MERGEJOIN_55] (rows=2301098 width=104)
                           Conds:RS_12._col1=RS_69._col0(Inner),Output:["_col2","_col5","_col6"]
                         <-Map 8 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_69]
@@ -95,7 +95,7 @@ Stage-0
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_12]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_54] (rows=550076554 width=110)
+                            Merge Join Operator [MERGEJOIN_54] (rows=15062131 width=4)
                               Conds:RS_66._col0=RS_58._col0(Inner),Output:["_col1","_col2"]
                             <-Map 6 [SIMPLE_EDGE] vectorized
                               PARTITION_ONLY_SHUFFLE [RS_58]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query53.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query53.q.out
index a512733..06726ba 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query53.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query53.q.out
@@ -78,32 +78,32 @@ Stage-0
     Stage-1
       Reducer 5 vectorized
       File Output Operator [FS_82]
-        Limit [LIM_81] (rows=100 width=228)
+        Limit [LIM_81] (rows=25 width=228)
           Number of rows:100
-          Select Operator [SEL_80] (rows=130 width=228)
+          Select Operator [SEL_80] (rows=25 width=228)
             Output:["_col0","_col1","_col2"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_27]
-              Select Operator [SEL_24] (rows=130 width=228)
+              Select Operator [SEL_24] (rows=25 width=228)
                 Output:["_col0","_col1","_col2"]
-                Top N Key Operator [TNK_41] (rows=130 width=228)
+                Top N Key Operator [TNK_41] (rows=25 width=228)
                   keys:avg_window_0, _col2, _col0,top n:100
-                  Filter Operator [FIL_36] (rows=130 width=228)
+                  Filter Operator [FIL_36] (rows=25 width=228)
                     predicate:CASE WHEN ((avg_window_0 > 0)) THEN (((abs((_col2 - avg_window_0)) / avg_window_0) > 0.1)) ELSE (false) END
-                    Select Operator [SEL_23] (rows=260 width=116)
+                    Select Operator [SEL_23] (rows=50 width=116)
                       Output:["avg_window_0","_col0","_col2"]
-                      PTF Operator [PTF_22] (rows=260 width=116)
+                      PTF Operator [PTF_22] (rows=50 width=116)
                         Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS FIRST","partition by:":"_col0"}]
-                        Select Operator [SEL_19] (rows=260 width=116)
+                        Select Operator [SEL_19] (rows=50 width=116)
                           Output:["_col0","_col2"]
-                          Group By Operator [GBY_18] (rows=260 width=120)
+                          Group By Operator [GBY_18] (rows=50 width=120)
                             Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_17]
                               PartitionCols:_col0
-                              Group By Operator [GBY_16] (rows=260 width=120)
+                              Group By Operator [GBY_16] (rows=50 width=120)
                                 Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col4, _col6
-                                Merge Join Operator [MERGEJOIN_63] (rows=569118 width=8)
+                                Merge Join Operator [MERGEJOIN_63] (rows=98800 width=8)
                                   Conds:RS_12._col0=RS_77._col0(Inner),Output:["_col2","_col4","_col6"]
                                 <-Map 8 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_77]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query54.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query54.q.out
index 08f68c0..5a2d93a 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query54.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query54.q.out
@@ -164,33 +164,33 @@ Stage-0
     Stage-1
       Reducer 8 vectorized
       File Output Operator [FS_373]
-        Limit [LIM_372] (rows=100 width=16)
+        Limit [LIM_372] (rows=1 width=16)
           Number of rows:100
-          Select Operator [SEL_371] (rows=338 width=16)
+          Select Operator [SEL_371] (rows=1 width=16)
             Output:["_col0","_col1","_col2"]
           <-Reducer 7 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_370]
-              Select Operator [SEL_369] (rows=338 width=16)
+              Select Operator [SEL_369] (rows=1 width=16)
                 Output:["_col0","_col1","_col2"]
-                Top N Key Operator [TNK_368] (rows=338 width=12)
+                Top N Key Operator [TNK_368] (rows=1 width=12)
                   keys:_col0, _col1,top n:100
-                  Group By Operator [GBY_367] (rows=338 width=12)
+                  Group By Operator [GBY_367] (rows=1 width=12)
                     Output:["_col0","_col1"],aggregations:["count(VALUE._col0)"],keys:KEY._col0
                   <-Reducer 6 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_366]
                       PartitionCols:_col0
-                      Group By Operator [GBY_365] (rows=338 width=12)
+                      Group By Operator [GBY_365] (rows=1 width=12)
                         Output:["_col0","_col1"],aggregations:["count()"],keys:_col0
-                        Select Operator [SEL_364] (rows=676 width=116)
+                        Select Operator [SEL_364] (rows=1 width=116)
                           Output:["_col0"]
-                          Top N Key Operator [TNK_363] (rows=676 width=116)
+                          Top N Key Operator [TNK_363] (rows=1 width=116)
                             keys:UDFToInteger((_col1 / 50)),top n:100
-                            Group By Operator [GBY_362] (rows=676 width=116)
+                            Group By Operator [GBY_362] (rows=1 width=116)
                               Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                             <-Reducer 5 [SIMPLE_EDGE]
                               SHUFFLE [RS_119]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_118] (rows=154128 width=116)
+                                Group By Operator [GBY_118] (rows=228 width=116)
                                   Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
                                   Merge Join Operator [MERGEJOIN_289] (rows=525327388 width=110)
                                     Conds:RS_114._col0=RS_115._col0(Inner),Output:["_col2","_col5"]
@@ -254,9 +254,9 @@ Stage-0
                                       <-Reducer 20 [SIMPLE_EDGE]
                                         SHUFFLE [RS_112]
                                           PartitionCols:_col0
-                                          Select Operator [SEL_76] (rows=4049224 width=4)
+                                          Select Operator [SEL_76] (rows=55046 width=4)
                                             Output:["_col0"]
-                                            Merge Join Operator [MERGEJOIN_286] (rows=4049224 width=4)
+                                            Merge Join Operator [MERGEJOIN_286] (rows=55046 width=4)
                                               Conds:RS_73._col0=RS_354._col1(Inner),Output:["_col5"]
                                             <-Reducer 19 [SIMPLE_EDGE]
                                               SHUFFLE [RS_73]
@@ -284,16 +284,16 @@ Stage-0
                                             <-Reducer 27 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_354]
                                                 PartitionCols:_col1
-                                                Select Operator [SEL_353] (rows=4049224 width=8)
+                                                Select Operator [SEL_353] (rows=55046 width=8)
                                                   Output:["_col0","_col1"]
-                                                  Group By Operator [GBY_352] (rows=4049224 width=8)
+                                                  Group By Operator [GBY_352] (rows=55046 width=8)
                                                     Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
                                                   <-Reducer 26 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_67]
                                                       PartitionCols:_col0, _col1
-                                                      Group By Operator [GBY_66] (rows=4049224 width=8)
+                                                      Group By Operator [GBY_66] (rows=55046 width=8)
                                                         Output:["_col0","_col1"],keys:_col6, _col5
-                                                        Merge Join Operator [MERGEJOIN_283] (rows=4049224 width=8)
+                                                        Merge Join Operator [MERGEJOIN_283] (rows=110092 width=8)
                                                           Conds:RS_62._col1=RS_351._col0(Inner),Output:["_col5","_col6"]
                                                         <-Map 32 [SIMPLE_EDGE] vectorized
                                                           SHUFFLE [RS_351]
@@ -307,7 +307,7 @@ Stage-0
                                                         <-Reducer 25 [SIMPLE_EDGE]
                                                           SHUFFLE [RS_62]
                                                             PartitionCols:_col1
-                                                            Merge Join Operator [MERGEJOIN_282] (rows=4049224 width=1)
+                                                            Merge Join Operator [MERGEJOIN_282] (rows=110092 width=0)
                                                               Conds:RS_59._col2=RS_348._col0(Inner),Output:["_col1"]
                                                             <-Map 31 [SIMPLE_EDGE] vectorized
                                                               SHUFFLE [RS_348]
@@ -321,7 +321,7 @@ Stage-0
                                                             <-Reducer 24 [SIMPLE_EDGE]
                                                               SHUFFLE [RS_59]
                                                                 PartitionCols:_col2
-                                                                Merge Join Operator [MERGEJOIN_281] (rows=429048824 width=7)
+                                                                Merge Join Operator [MERGEJOIN_281] (rows=11665117 width=7)
                                                                   Conds:Union 23._col0=RS_342._col0(Inner),Output:["_col1","_col2"]
                                                                 <-Map 29 [SIMPLE_EDGE] vectorized
                                                                   PARTITION_ONLY_SHUFFLE [RS_342]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query55.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query55.q.out
index 26137df..3ce5cef 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query55.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query55.q.out
@@ -65,7 +65,7 @@ Stage-0
                       PartitionCols:_col0, _col1
                       Group By Operator [GBY_16] (rows=7333 width=216)
                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col5, _col6
-                        Merge Join Operator [MERGEJOIN_55] (rows=84037218 width=183)
+                        Merge Join Operator [MERGEJOIN_55] (rows=2301098 width=104)
                           Conds:RS_12._col1=RS_69._col0(Inner),Output:["_col2","_col5","_col6"]
                         <-Map 8 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_69]
@@ -79,7 +79,7 @@ Stage-0
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_12]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_54] (rows=550076554 width=110)
+                            Merge Join Operator [MERGEJOIN_54] (rows=15062131 width=4)
                               Conds:RS_66._col0=RS_58._col0(Inner),Output:["_col1","_col2"]
                             <-Map 6 [SIMPLE_EDGE] vectorized
                               PARTITION_ONLY_SHUFFLE [RS_58]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query56.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query56.q.out
index e9b34e6..aac99e9 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query56.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query56.q.out
@@ -199,9 +199,9 @@ Stage-0
                         <-Reducer 10 [SIMPLE_EDGE]
                           SHUFFLE [RS_106]
                             PartitionCols:_col0
-                            Group By Operator [GBY_105] (rows=9585 width=212)
+                            Group By Operator [GBY_105] (rows=355 width=212)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_302] (rows=31485548 width=211)
+                              Merge Join Operator [MERGEJOIN_302] (rows=172427 width=188)
                                 Conds:RS_101._col0=RS_102._col2(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_101]
@@ -234,9 +234,9 @@ Stage-0
                               <-Reducer 23 [SIMPLE_EDGE]
                                 SHUFFLE [RS_102]
                                   PartitionCols:_col2
-                                  Select Operator [SEL_97] (rows=143931246 width=115)
+                                  Select Operator [SEL_97] (rows=788222 width=110)
                                     Output:["_col2","_col4"]
-                                    Merge Join Operator [MERGEJOIN_299] (rows=143931246 width=115)
+                                    Merge Join Operator [MERGEJOIN_299] (rows=788222 width=110)
                                       Conds:RS_94._col2=RS_346._col0(Inner),Output:["_col1","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_346]
@@ -250,7 +250,7 @@ Stage-0
                                     <-Reducer 22 [SIMPLE_EDGE]
                                       SHUFFLE [RS_94]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_298] (rows=143931246 width=119)
+                                        Merge Join Operator [MERGEJOIN_298] (rows=3941109 width=118)
                                           Conds:RS_368._col0=RS_329._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_329]
@@ -291,9 +291,9 @@ Stage-0
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_33]
                             PartitionCols:_col0
-                            Group By Operator [GBY_32] (rows=30175 width=212)
+                            Group By Operator [GBY_32] (rows=355 width=212)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_300] (rows=114917468 width=188)
+                              Merge Join Operator [MERGEJOIN_300] (rows=629332 width=100)
                                 Conds:RS_28._col0=RS_29._col2(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_28]
@@ -302,9 +302,9 @@ Stage-0
                               <-Reducer 16 [SIMPLE_EDGE]
                                 SHUFFLE [RS_29]
                                   PartitionCols:_col2
-                                  Select Operator [SEL_24] (rows=525327191 width=110)
+                                  Select Operator [SEL_24] (rows=2876890 width=4)
                                     Output:["_col2","_col4"]
-                                    Merge Join Operator [MERGEJOIN_293] (rows=525327191 width=110)
+                                    Merge Join Operator [MERGEJOIN_293] (rows=2876890 width=4)
                                       Conds:RS_21._col2=RS_344._col0(Inner),Output:["_col1","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_344]
@@ -313,7 +313,7 @@ Stage-0
                                     <-Reducer 15 [SIMPLE_EDGE]
                                       SHUFFLE [RS_21]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_292] (rows=525327191 width=114)
+                                        Merge Join Operator [MERGEJOIN_292] (rows=14384447 width=4)
                                           Conds:RS_341._col0=RS_325._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_325]
@@ -349,9 +349,9 @@ Stage-0
                         <-Reducer 8 [SIMPLE_EDGE]
                           SHUFFLE [RS_69]
                             PartitionCols:_col0
-                            Group By Operator [GBY_68] (rows=18460 width=212)
+                            Group By Operator [GBY_68] (rows=355 width=212)
                               Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                              Merge Join Operator [MERGEJOIN_301] (rows=62370668 width=209)
+                              Merge Join Operator [MERGEJOIN_301] (rows=339151 width=100)
                                 Conds:RS_64._col0=RS_65._col3(Inner),Output:["_col1","_col7"]
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_64]
@@ -360,9 +360,9 @@ Stage-0
                               <-Reducer 20 [SIMPLE_EDGE]
                                 SHUFFLE [RS_65]
                                   PartitionCols:_col3
-                                  Select Operator [SEL_60] (rows=285117733 width=115)
+                                  Select Operator [SEL_60] (rows=1550375 width=13)
                                     Output:["_col3","_col4"]
-                                    Merge Join Operator [MERGEJOIN_296] (rows=285117733 width=115)
+                                    Merge Join Operator [MERGEJOIN_296] (rows=1550375 width=13)
                                       Conds:RS_57._col1=RS_345._col0(Inner),Output:["_col2","_col3"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_345]
@@ -371,7 +371,7 @@ Stage-0
                                     <-Reducer 19 [SIMPLE_EDGE]
                                       SHUFFLE [RS_57]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_295] (rows=285117733 width=119)
+                                        Merge Join Operator [MERGEJOIN_295] (rows=7751872 width=98)
                                           Conds:RS_360._col0=RS_327._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_327]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query57.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query57.q.out
index 15b6f1a..49a1ba5 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query57.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query57.q.out
@@ -155,9 +155,9 @@ Stage-0
                                 <-Reducer 4 [SIMPLE_EDGE]
                                   SHUFFLE [RS_93]
                                     PartitionCols:_col0, _col1, _col2, _col3, _col4
-                                    Group By Operator [GBY_92] (rows=285117980 width=408)
+                                    Group By Operator [GBY_92] (rows=87441185 width=408)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col8, _col10, _col11
-                                      Merge Join Operator [MERGEJOIN_277] (rows=285117980 width=407)
+                                      Merge Join Operator [MERGEJOIN_277] (rows=87441185 width=406)
                                         Conds:RS_88._col2=RS_296._col0(Inner),Output:["_col3","_col5","_col6","_col8","_col10","_col11"]
                                       <-Map 15 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_296]
@@ -171,7 +171,7 @@ Stage-0
                                       <-Reducer 3 [SIMPLE_EDGE]
                                         SHUFFLE [RS_88]
                                           PartitionCols:_col2
-                                          Merge Join Operator [MERGEJOIN_276] (rows=285117980 width=221)
+                                          Merge Join Operator [MERGEJOIN_276] (rows=87441185 width=220)
                                             Conds:RS_85._col1=RS_293._col0(Inner),Output:["_col2","_col3","_col5","_col6","_col8"]
                                           <-Map 14 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_293]
@@ -185,7 +185,7 @@ Stage-0
                                           <-Reducer 2 [SIMPLE_EDGE]
                                             SHUFFLE [RS_85]
                                               PartitionCols:_col1
-                                              Merge Join Operator [MERGEJOIN_275] (rows=285117980 width=127)
+                                              Merge Join Operator [MERGEJOIN_275] (rows=87441185 width=126)
                                                 Conds:RS_290._col0=RS_282._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6"]
                                               <-Map 12 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_282]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query58.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query58.q.out
index 7a25650..b1593b3 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query58.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query58.q.out
@@ -184,21 +184,21 @@ Stage-0
                   keys:_col0, _col3,top n:100
                   Filter Operator [FIL_152] (rows=1 width=660)
                     predicate:(_col5 BETWEEN (0.9 * _col1) AND (1.1 * _col1) and _col5 BETWEEN (0.9 * _col3) AND (1.1 * _col3) and _col1 BETWEEN _col6 AND _col7 and _col3 BETWEEN _col6 AND _col7)
-                    Merge Join Operator [MERGEJOIN_423] (rows=3836 width=660)
+                    Merge Join Operator [MERGEJOIN_423] (rows=384 width=660)
                       Conds:RS_149._col0=RS_468._col0(Inner),Output:["_col0","_col1","_col3","_col5","_col6","_col7"]
                     <-Reducer 16 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_468]
                         PartitionCols:_col0
-                        Select Operator [SEL_467] (rows=310774 width=436)
+                        Select Operator [SEL_467] (rows=15768 width=436)
                           Output:["_col0","_col1","_col2","_col3"]
-                          Group By Operator [GBY_466] (rows=310774 width=212)
+                          Group By Operator [GBY_466] (rows=15768 width=212)
                             Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                           <-Reducer 15 [SIMPLE_EDGE]
                             SHUFFLE [RS_141]
                               PartitionCols:_col0
-                              Group By Operator [GBY_140] (rows=37292880 width=212)
+                              Group By Operator [GBY_140] (rows=15768 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(_col5)"],keys:_col7
-                                Merge Join Operator [MERGEJOIN_421] (rows=143966864 width=211)
+                                Merge Join Operator [MERGEJOIN_421] (rows=31537 width=100)
                                   Conds:RS_136._col4=RS_451._col0(Inner),Output:["_col5","_col7"]
                                 <-Map 25 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_451]
@@ -210,7 +210,7 @@ Stage-0
                                 <-Reducer 14 [SIMPLE_EDGE]
                                   SHUFFLE [RS_136]
                                     PartitionCols:_col4
-                                    Merge Join Operator [MERGEJOIN_420] (rows=143966864 width=115)
+                                    Merge Join Operator [MERGEJOIN_420] (rows=31537 width=4)
                                       Conds:RS_133._col0=RS_465._col0(Inner),Output:["_col4","_col5"]
                                     <-Reducer 2 [SIMPLE_EDGE]
                                       PARTITION_ONLY_SHUFFLE [RS_133]
@@ -298,21 +298,21 @@ Stage-0
                     <-Reducer 6 [SIMPLE_EDGE]
                       SHUFFLE [RS_149]
                         PartitionCols:_col0
-                        Filter Operator [FIL_147] (rows=3836 width=324)
+                        Filter Operator [FIL_147] (rows=384 width=324)
                           predicate:(_col1 BETWEEN (0.9 * _col3) AND (1.1 * _col3) and _col3 BETWEEN (0.9 * _col1) AND (1.1 * _col1))
-                          Merge Join Operator [MERGEJOIN_422] (rows=310774 width=324)
+                          Merge Join Operator [MERGEJOIN_422] (rows=31163 width=324)
                             Conds:RS_453._col0=RS_460._col0(Inner),Output:["_col0","_col1","_col3"]
                           <-Reducer 12 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_460]
                               PartitionCols:_col0
-                              Group By Operator [GBY_459] (rows=310774 width=212)
+                              Group By Operator [GBY_459] (rows=60249 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                               <-Reducer 11 [SIMPLE_EDGE]
                                 SHUFFLE [RS_93]
                                   PartitionCols:_col0
-                                  Group By Operator [GBY_92] (rows=138294430 width=212)
+                                  Group By Operator [GBY_92] (rows=60249 width=212)
                                     Output:["_col0","_col1"],aggregations:["sum(_col5)"],keys:_col7
-                                    Merge Join Operator [MERGEJOIN_416] (rows=550076554 width=206)
+                                    Merge Join Operator [MERGEJOIN_416] (rows=120498 width=100)
                                       Conds:RS_88._col4=RS_450._col0(Inner),Output:["_col5","_col7"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_450]
@@ -321,7 +321,7 @@ Stage-0
                                     <-Reducer 10 [SIMPLE_EDGE]
                                       SHUFFLE [RS_88]
                                         PartitionCols:_col4
-                                        Merge Join Operator [MERGEJOIN_415] (rows=550076554 width=110)
+                                        Merge Join Operator [MERGEJOIN_415] (rows=120498 width=4)
                                           Conds:RS_85._col0=RS_458._col0(Inner),Output:["_col4","_col5"]
                                         <-Reducer 2 [SIMPLE_EDGE]
                                           PARTITION_ONLY_SHUFFLE [RS_85]
@@ -350,14 +350,14 @@ Stage-0
                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_453]
                               PartitionCols:_col0
-                              Group By Operator [GBY_452] (rows=310774 width=212)
+                              Group By Operator [GBY_452] (rows=31163 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                               <-Reducer 4 [SIMPLE_EDGE]
                                 SHUFFLE [RS_45]
                                   PartitionCols:_col0
-                                  Group By Operator [GBY_44] (rows=73653438 width=212)
+                                  Group By Operator [GBY_44] (rows=31163 width=212)
                                     Output:["_col0","_col1"],aggregations:["sum(_col5)"],keys:_col7
-                                    Merge Join Operator [MERGEJOIN_411] (rows=286549727 width=211)
+                                    Merge Join Operator [MERGEJOIN_411] (rows=62327 width=100)
                                       Conds:RS_40._col4=RS_449._col0(Inner),Output:["_col5","_col7"]
                                     <-Map 25 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_449]
@@ -366,7 +366,7 @@ Stage-0
                                     <-Reducer 3 [SIMPLE_EDGE]
                                       SHUFFLE [RS_40]
                                         PartitionCols:_col4
-                                        Merge Join Operator [MERGEJOIN_410] (rows=286549727 width=115)
+                                        Merge Join Operator [MERGEJOIN_410] (rows=62327 width=4)
                                           Conds:RS_37._col0=RS_447._col0(Inner),Output:["_col4","_col5"]
                                         <-Reducer 2 [SIMPLE_EDGE]
                                           PARTITION_ONLY_SHUFFLE [RS_37]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query59.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query59.q.out
index 341b400..f7c7260 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query59.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query59.q.out
@@ -114,22 +114,22 @@ Stage-0
       File Output Operator [FS_208]
         Limit [LIM_207] (rows=100 width=976)
           Number of rows:100
-          Select Operator [SEL_206] (rows=862591 width=976)
+          Select Operator [SEL_206] (rows=1012347 width=976)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           <-Reducer 6 [SIMPLE_EDGE]
             SHUFFLE [RS_57]
-              Select Operator [SEL_56] (rows=862591 width=976)
+              Select Operator [SEL_56] (rows=1012347 width=976)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                Top N Key Operator [TNK_95] (rows=862591 width=1648)
+                Top N Key Operator [TNK_95] (rows=1012347 width=1648)
                   keys:_col12, _col11, _col0,top n:100
-                  Merge Join Operator [MERGEJOIN_182] (rows=862591 width=1648)
+                  Merge Join Operator [MERGEJOIN_182] (rows=1012347 width=1648)
                     Conds:RS_53._col11, _col0=RS_54._col1, (_col0 - 52)(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col11","_col12","_col15","_col16","_col17","_col18","_col19","_col20"]
                   <-Reducer 11 [SIMPLE_EDGE]
                     SHUFFLE [RS_54]
                       PartitionCols:_col1, (_col0 - 52)
-                      Select Operator [SEL_46] (rows=26628 width=776)
+                      Select Operator [SEL_46] (rows=28847 width=776)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                        Merge Join Operator [MERGEJOIN_181] (rows=26628 width=776)
+                        Merge Join Operator [MERGEJOIN_181] (rows=28847 width=776)
                           Conds:RS_43._col1=RS_205._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col10"]
                         <-Map 15 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_205]
@@ -141,7 +141,7 @@ Stage-0
                         <-Reducer 10 [SIMPLE_EDGE]
                           SHUFFLE [RS_43]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_180] (rows=26628 width=676)
+                            Merge Join Operator [MERGEJOIN_180] (rows=28847 width=676)
                               Conds:RS_203._col0=RS_199._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                             <-Map 13 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_199]
@@ -155,7 +155,7 @@ Stage-0
                             <-Reducer 9 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_203]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_202] (rows=1104768 width=679)
+                                Group By Operator [GBY_202] (rows=1196832 width=679)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)"],keys:KEY._col0, KEY._col1
                                 <-Reducer 8 [SIMPLE_EDGE]
                                   SHUFFLE [RS_32]
@@ -187,7 +187,7 @@ Stage-0
                   <-Reducer 5 [SIMPLE_EDGE]
                     SHUFFLE [RS_53]
                       PartitionCols:_col11, _col0
-                      Merge Join Operator [MERGEJOIN_178] (rows=26628 width=976)
+                      Merge Join Operator [MERGEJOIN_178] (rows=28847 width=976)
                         Conds:RS_50._col1=RS_201._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col11","_col12"]
                       <-Map 14 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_201]
@@ -199,7 +199,7 @@ Stage-0
                       <-Reducer 4 [SIMPLE_EDGE]
                         SHUFFLE [RS_50]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_177] (rows=26628 width=788)
+                          Merge Join Operator [MERGEJOIN_177] (rows=28847 width=788)
                             Conds:RS_193._col0=RS_198._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
                           <-Map 13 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_198]
@@ -212,7 +212,7 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_193]
                               PartitionCols:_col0
-                              Group By Operator [GBY_192] (rows=1104768 width=791)
+                              Group By Operator [GBY_192] (rows=1196832 width=791)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"],keys:KEY._col0, KEY._col1
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_12]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query60.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query60.q.out
index 8a4bca1..a711f8a 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query60.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query60.q.out
@@ -221,9 +221,9 @@ Stage-0
                           <-Reducer 10 [SIMPLE_EDGE]
                             SHUFFLE [RS_106]
                               PartitionCols:_col0
-                              Group By Operator [GBY_105] (rows=99586 width=212)
+                              Group By Operator [GBY_105] (rows=1717 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                                Merge Join Operator [MERGEJOIN_307] (rows=69268204 width=211)
+                                Merge Join Operator [MERGEJOIN_307] (rows=379339 width=201)
                                   Conds:RS_101._col0=RS_102._col2(Inner),Output:["_col1","_col7"]
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_101]
@@ -256,9 +256,9 @@ Stage-0
                                 <-Reducer 23 [SIMPLE_EDGE]
                                   SHUFFLE [RS_102]
                                     PartitionCols:_col2
-                                    Select Operator [SEL_97] (rows=143931246 width=115)
+                                    Select Operator [SEL_97] (rows=788222 width=110)
                                       Output:["_col2","_col4"]
-                                      Merge Join Operator [MERGEJOIN_304] (rows=143931246 width=115)
+                                      Merge Join Operator [MERGEJOIN_304] (rows=788222 width=110)
                                         Conds:RS_94._col2=RS_354._col0(Inner),Output:["_col1","_col3"]
                                       <-Map 25 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_354]
@@ -272,7 +272,7 @@ Stage-0
                                       <-Reducer 22 [SIMPLE_EDGE]
                                         SHUFFLE [RS_94]
                                           PartitionCols:_col2
-                                          Merge Join Operator [MERGEJOIN_303] (rows=143931246 width=119)
+                                          Merge Join Operator [MERGEJOIN_303] (rows=3941109 width=118)
                                             Conds:RS_378._col0=RS_337._col0(Inner),Output:["_col1","_col2","_col3"]
                                           <-Map 17 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_337]
@@ -315,9 +315,9 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_33]
                               PartitionCols:_col0
-                              Group By Operator [GBY_32] (rows=343400 width=212)
+                              Group By Operator [GBY_32] (rows=1717 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                                Merge Join Operator [MERGEJOIN_305] (rows=252818424 width=201)
+                                Merge Join Operator [MERGEJOIN_305] (rows=1384530 width=100)
                                   Conds:RS_28._col0=RS_29._col2(Inner),Output:["_col1","_col7"]
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_28]
@@ -326,9 +326,9 @@ Stage-0
                                 <-Reducer 16 [SIMPLE_EDGE]
                                   SHUFFLE [RS_29]
                                     PartitionCols:_col2
-                                    Select Operator [SEL_24] (rows=525327191 width=110)
+                                    Select Operator [SEL_24] (rows=2876890 width=4)
                                       Output:["_col2","_col4"]
-                                      Merge Join Operator [MERGEJOIN_298] (rows=525327191 width=110)
+                                      Merge Join Operator [MERGEJOIN_298] (rows=2876890 width=4)
                                         Conds:RS_21._col2=RS_352._col0(Inner),Output:["_col1","_col3"]
                                       <-Map 25 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_352]
@@ -337,7 +337,7 @@ Stage-0
                                       <-Reducer 15 [SIMPLE_EDGE]
                                         SHUFFLE [RS_21]
                                           PartitionCols:_col2
-                                          Merge Join Operator [MERGEJOIN_297] (rows=525327191 width=114)
+                                          Merge Join Operator [MERGEJOIN_297] (rows=14384447 width=4)
                                             Conds:RS_349._col0=RS_333._col0(Inner),Output:["_col1","_col2","_col3"]
                                           <-Map 17 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_333]
@@ -375,9 +375,9 @@ Stage-0
                           <-Reducer 8 [SIMPLE_EDGE]
                             SHUFFLE [RS_69]
                               PartitionCols:_col0
-                              Group By Operator [GBY_68] (rows=195738 width=212)
+                              Group By Operator [GBY_68] (rows=1717 width=212)
                                 Output:["_col0","_col1"],aggregations:["sum(_col7)"],keys:_col1
-                                Merge Join Operator [MERGEJOIN_306] (rows=137215467 width=210)
+                                Merge Join Operator [MERGEJOIN_306] (rows=746132 width=100)
                                   Conds:RS_64._col0=RS_65._col3(Inner),Output:["_col1","_col7"]
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_64]
@@ -386,9 +386,9 @@ Stage-0
                                 <-Reducer 20 [SIMPLE_EDGE]
                                   SHUFFLE [RS_65]
                                     PartitionCols:_col3
-                                    Select Operator [SEL_60] (rows=285117733 width=115)
+                                    Select Operator [SEL_60] (rows=1550375 width=13)
                                       Output:["_col3","_col4"]
-                                      Merge Join Operator [MERGEJOIN_301] (rows=285117733 width=115)
+                                      Merge Join Operator [MERGEJOIN_301] (rows=1550375 width=13)
                                         Conds:RS_57._col1=RS_353._col0(Inner),Output:["_col2","_col3"]
                                       <-Map 25 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_353]
@@ -397,7 +397,7 @@ Stage-0
                                       <-Reducer 19 [SIMPLE_EDGE]
                                         SHUFFLE [RS_57]
                                           PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_300] (rows=285117733 width=119)
+                                          Merge Join Operator [MERGEJOIN_300] (rows=7751872 width=98)
                                             Conds:RS_369._col0=RS_335._col0(Inner),Output:["_col1","_col2","_col3"]
                                           <-Map 17 [SIMPLE_EDGE] vectorized
                                             PARTITION_ONLY_SHUFFLE [RS_335]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query61.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query61.q.out
index 6da93b1..b7dbd43 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query61.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query61.q.out
@@ -140,7 +140,7 @@ Stage-0
                 PARTITION_ONLY_SHUFFLE [RS_42]
                   Group By Operator [GBY_41] (rows=1 width=112)
                     Output:["_col0"],aggregations:["sum(_col8)"]
-                    Merge Join Operator [MERGEJOIN_261] (rows=461162530 width=106)
+                    Merge Join Operator [MERGEJOIN_261] (rows=505397 width=0)
                       Conds:RS_37._col0=RS_38._col2(Inner),Output:["_col8"]
                     <-Reducer 2 [SIMPLE_EDGE]
                       SHUFFLE [RS_37]
@@ -168,7 +168,7 @@ Stage-0
                     <-Reducer 13 [SIMPLE_EDGE]
                       SHUFFLE [RS_38]
                         PartitionCols:_col2
-                        Merge Join Operator [MERGEJOIN_256] (rows=461162530 width=110)
+                        Merge Join Operator [MERGEJOIN_256] (rows=2526982 width=0)
                           Conds:RS_30._col4=RS_295._col0(Inner),Output:["_col2","_col5"]
                         <-Map 22 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_295]
@@ -182,7 +182,7 @@ Stage-0
                         <-Reducer 12 [SIMPLE_EDGE]
                           SHUFFLE [RS_30]
                             PartitionCols:_col4
-                            Merge Join Operator [MERGEJOIN_255] (rows=461162530 width=114)
+                            Merge Join Operator [MERGEJOIN_255] (rows=2526982 width=0)
                               Conds:RS_27._col3=RS_291._col0(Inner),Output:["_col2","_col4","_col5"]
                             <-Map 21 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_291]
@@ -196,7 +196,7 @@ Stage-0
                             <-Reducer 11 [SIMPLE_EDGE]
                               SHUFFLE [RS_27]
                                 PartitionCols:_col3
-                                Merge Join Operator [MERGEJOIN_254] (rows=461162530 width=118)
+                                Merge Join Operator [MERGEJOIN_254] (rows=12627499 width=0)
                                   Conds:RS_24._col1=RS_287._col0(Inner),Output:["_col2","_col3","_col4","_col5"]
                                 <-Map 20 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_287]
@@ -210,7 +210,7 @@ Stage-0
                                 <-Reducer 10 [SIMPLE_EDGE]
                                   SHUFFLE [RS_24]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_253] (rows=479120969 width=122)
+                                    Merge Join Operator [MERGEJOIN_253] (rows=13119234 width=4)
                                       Conds:RS_284._col0=RS_272._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5"]
                                     <-Map 14 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_272]
@@ -249,7 +249,7 @@ Stage-0
                 PARTITION_ONLY_SHUFFLE [RS_81]
                   Group By Operator [GBY_80] (rows=1 width=112)
                     Output:["_col0"],aggregations:["sum(_col7)"]
-                    Merge Join Operator [MERGEJOIN_262] (rows=482889610 width=106)
+                    Merge Join Operator [MERGEJOIN_262] (rows=529208 width=0)
                       Conds:RS_76._col0=RS_77._col2(Inner),Output:["_col7"]
                     <-Reducer 2 [SIMPLE_EDGE]
                       SHUFFLE [RS_76]
@@ -258,7 +258,7 @@ Stage-0
                     <-Reducer 18 [SIMPLE_EDGE]
                       SHUFFLE [RS_77]
                         PartitionCols:_col2
-                        Merge Join Operator [MERGEJOIN_260] (rows=482889610 width=110)
+                        Merge Join Operator [MERGEJOIN_260] (rows=2646038 width=0)
                           Conds:RS_69._col3=RS_292._col0(Inner),Output:["_col2","_col4"]
                         <-Map 21 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_292]
@@ -267,7 +267,7 @@ Stage-0
                         <-Reducer 17 [SIMPLE_EDGE]
                           SHUFFLE [RS_69]
                             PartitionCols:_col3
-                            Merge Join Operator [MERGEJOIN_259] (rows=482889610 width=114)
+                            Merge Join Operator [MERGEJOIN_259] (rows=13222427 width=0)
                               Conds:RS_66._col1=RS_288._col0(Inner),Output:["_col2","_col3","_col4"]
                             <-Map 20 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_288]
@@ -276,7 +276,7 @@ Stage-0
                             <-Reducer 16 [SIMPLE_EDGE]
                               SHUFFLE [RS_66]
                                 PartitionCols:_col1
-                                Merge Join Operator [MERGEJOIN_258] (rows=501694138 width=118)
+                                Merge Join Operator [MERGEJOIN_258] (rows=13737330 width=4)
                                   Conds:RS_302._col0=RS_274._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                 <-Map 14 [SIMPLE_EDGE] vectorized
                                   PARTITION_ONLY_SHUFFLE [RS_274]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query63.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query63.q.out
index d44f819..cdcd316 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query63.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query63.q.out
@@ -80,32 +80,32 @@ Stage-0
     Stage-1
       Reducer 5 vectorized
       File Output Operator [FS_82]
-        Limit [LIM_81] (rows=100 width=228)
+        Limit [LIM_81] (rows=65 width=228)
           Number of rows:100
-          Select Operator [SEL_80] (rows=338 width=228)
+          Select Operator [SEL_80] (rows=65 width=228)
             Output:["_col0","_col1","_col2"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_27]
-              Select Operator [SEL_24] (rows=338 width=228)
+              Select Operator [SEL_24] (rows=65 width=228)
                 Output:["_col0","_col1","_col2"]
-                Top N Key Operator [TNK_41] (rows=338 width=228)
+                Top N Key Operator [TNK_41] (rows=65 width=228)
                   keys:_col0, avg_window_0, _col2,top n:100
-                  Filter Operator [FIL_36] (rows=338 width=228)
+                  Filter Operator [FIL_36] (rows=65 width=228)
                     predicate:CASE WHEN ((avg_window_0 > 0)) THEN (((abs((_col2 - avg_window_0)) / avg_window_0) > 0.1)) ELSE (false) END
-                    Select Operator [SEL_23] (rows=676 width=116)
+                    Select Operator [SEL_23] (rows=130 width=116)
                       Output:["avg_window_0","_col0","_col2"]
-                      PTF Operator [PTF_22] (rows=676 width=116)
+                      PTF Operator [PTF_22] (rows=130 width=116)
                         Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS FIRST","partition by:":"_col0"}]
-                        Select Operator [SEL_19] (rows=676 width=116)
+                        Select Operator [SEL_19] (rows=130 width=116)
                           Output:["_col0","_col2"]
-                          Group By Operator [GBY_18] (rows=676 width=120)
+                          Group By Operator [GBY_18] (rows=130 width=120)
                             Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_17]
                               PartitionCols:_col0
-                              Group By Operator [GBY_16] (rows=676 width=120)
+                              Group By Operator [GBY_16] (rows=130 width=120)
                                 Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)"],keys:_col4, _col6
-                                Merge Join Operator [MERGEJOIN_63] (rows=569118 width=8)
+                                Merge Join Operator [MERGEJOIN_63] (rows=98800 width=8)
                                   Conds:RS_12._col0=RS_77._col0(Inner),Output:["_col2","_col4","_col6"]
                                 <-Map 8 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_77]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query64.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query64.q.out
index 77bd755..e36adb5 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query64.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query64.q.out
@@ -316,33 +316,33 @@ Stage-0
     Stage-1
       Reducer 18 vectorized
       File Output Operator [FS_1079]
-        Select Operator [SEL_1078] (rows=338108448450 width=1702)
+        Select Operator [SEL_1078] (rows=104628491644 width=1702)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20"]
         <-Reducer 17 [SIMPLE_EDGE]
           SHUFFLE [RS_201]
-            Select Operator [SEL_200] (rows=338108448450 width=1694)
+            Select Operator [SEL_200] (rows=104628491644 width=1694)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18"]
-              Filter Operator [FIL_199] (rows=338108448450 width=1694)
+              Filter Operator [FIL_199] (rows=104628491644 width=1694)
                 predicate:(_col3 <= _col19)
-                Merge Join Operator [MERGEJOIN_977] (rows=1014325345351 width=1694)
+                Merge Join Operator [MERGEJOIN_977] (rows=313885474933 width=1694)
                   Conds:RS_1052._col1, _col0, _col2=RS_1077._col2, _col1, _col3(Inner),Output:["_col3","_col4","_col5","_col6","_col7","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20","_col21","_col22"]
                 <-Reducer 16 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_1052]
                     PartitionCols:_col1, _col0, _col2
-                    Select Operator [SEL_1051] (rows=68803026 width=525)
+                    Select Operator [SEL_1051] (rows=21304422 width=525)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                      Filter Operator [FIL_1050] (rows=68803026 width=1255)
+                      Filter Operator [FIL_1050] (rows=21304422 width=1255)
                         predicate:_col13 is not null
-                        Select Operator [SEL_1049] (rows=68803026 width=1255)
+                        Select Operator [SEL_1049] (rows=21304422 width=1255)
                           Output:["_col0","_col1","_col2","_col13","_col14","_col15","_col16"]
-                          Group By Operator [GBY_1048] (rows=68803026 width=1255)
+                          Group By Operator [GBY_1048] (rows=21304422 width=1255)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7, KEY._col8, KEY._col9, KEY._col10, KEY._col11, KEY._col12
                           <-Reducer 15 [SIMPLE_EDGE]
                             SHUFFLE [RS_93]
                               PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12
-                              Group By Operator [GBY_92] (rows=68803026 width=1255)
+                              Group By Operator [GBY_92] (rows=21304422 width=1255)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16"],aggregations:["count()","sum(_col8)","sum(_col9)","sum(_col10)"],keys:_col24, _col11, _col25, _col29, _col31, _col37, _col38, _col39, _col40, _col42, _col43, _col44, _col45
-                                Merge Join Operator [MERGEJOIN_961] (rows=68803026 width=1155)
+                                Merge Join Operator [MERGEJOIN_961] (rows=21304422 width=1048)
                                   Conds:RS_88._col17=RS_1045._col0(Inner),Output:["_col8","_col9","_col10","_col11","_col24","_col25","_col29","_col31","_col37","_col38","_col39","_col40","_col42","_col43","_col44","_col45"]
                                 <-Map 49 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_1045]
@@ -354,7 +354,7 @@ Stage-0
                                 <-Reducer 14 [SIMPLE_EDGE]
                                   SHUFFLE [RS_88]
                                     PartitionCols:_col17
-                                    Merge Join Operator [MERGEJOIN_960] (rows=68803026 width=798)
+                                    Merge Join Operator [MERGEJOIN_960] (rows=21304422 width=691)
                                       Conds:RS_85._col5=RS_1044._col0(Inner),Output:["_col8","_col9","_col10","_col11","_col17","_col24","_col25","_col29","_col31","_col37","_col38","_col39","_col40"]
                                     <-Map 49 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_1044]
@@ -363,9 +363,9 @@ Stage-0
                                     <-Reducer 13 [SIMPLE_EDGE]
                                       SHUFFLE [RS_85]
                                         PartitionCols:_col5
-                                        Filter Operator [FIL_84] (rows=68803026 width=610)
+                                        Filter Operator [FIL_84] (rows=21304422 width=502)
                                           predicate:(_col33 <> _col35)
-                                          Merge Join Operator [MERGEJOIN_959] (rows=68803026 width=610)
+                                          Merge Join Operator [MERGEJOIN_959] (rows=21304422 width=502)
                                             Conds:RS_81._col15=RS_1040._col0(Inner),Output:["_col5","_col8","_col9","_col10","_col11","_col17","_col24","_col25","_col29","_col31","_col33","_col35"]
                                           <-Map 48 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_1040]
@@ -377,7 +377,7 @@ Stage-0
                                           <-Reducer 12 [SIMPLE_EDGE]
                                             SHUFFLE [RS_81]
                                               PartitionCols:_col15
-                                              Merge Join Operator [MERGEJOIN_958] (rows=67843635 width=527)
+                                              Merge Join Operator [MERGEJOIN_958] (rows=21007353 width=418)
                                                 Conds:RS_78._col3=RS_1039._col0(Inner),Output:["_col5","_col8","_col9","_col10","_col11","_col15","_col17","_col24","_col25","_col29","_col31","_col33"]
                                               <-Map 48 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_1039]
@@ -386,7 +386,7 @@ Stage-0
                                               <-Reducer 11 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_78]
                                                   PartitionCols:_col3
-                                                  Merge Join Operator [MERGEJOIN_957] (rows=66897622 width=444)
+                                                  Merge Join Operator [MERGEJOIN_957] (rows=20714426 width=331)
                                                     Conds:RS_75._col18=RS_984._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col15","_col17","_col24","_col25","_col29","_col31"]
                                                   <-Map 44 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_984]
@@ -398,7 +398,7 @@ Stage-0
                                                   <-Reducer 10 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_75]
                                                       PartitionCols:_col18
-                                                      Merge Join Operator [MERGEJOIN_956] (rows=66897622 width=444)
+                                                      Merge Join Operator [MERGEJOIN_956] (rows=20714426 width=331)
                                                         Conds:RS_72._col19=RS_986._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col15","_col17","_col18","_col24","_col25","_col29"]
                                                       <-Map 44 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_986]
@@ -409,7 +409,7 @@ Stage-0
                                                       <-Reducer 9 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_72]
                                                           PartitionCols:_col19
-                                                          Merge Join Operator [MERGEJOIN_955] (rows=66897622 width=444)
+                                                          Merge Join Operator [MERGEJOIN_955] (rows=20714426 width=330)
                                                             Conds:RS_69._col16=RS_1035._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col15","_col17","_col18","_col19","_col24","_col25"]
                                                           <-Map 43 [SIMPLE_EDGE] vectorized
                                                             SHUFFLE [RS_1035]
@@ -423,7 +423,7 @@ Stage-0
                                                           <-Reducer 8 [SIMPLE_EDGE]
                                                             SHUFFLE [RS_69]
                                                               PartitionCols:_col16
-                                                              Merge Join Operator [MERGEJOIN_954] (rows=66897622 width=447)
+                                                              Merge Join Operator [MERGEJOIN_954] (rows=20714426 width=334)
                                                                 Conds:RS_66._col4=RS_1034._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col15","_col16","_col17","_col18","_col19","_col24","_col25"]
                                                               <-Map 43 [SIMPLE_EDGE] vectorized
                                                                 SHUFFLE [RS_1034]
@@ -432,7 +432,7 @@ Stage-0
                                                               <-Reducer 7 [SIMPLE_EDGE]
                                                                 SHUFFLE [RS_66]
                                                                   PartitionCols:_col4
-                                                                  Merge Join Operator [MERGEJOIN_953] (rows=66897622 width=450)
+                                                                  Merge Join Operator [MERGEJOIN_953] (rows=20714426 width=336)
                                                                     Conds:RS_63._col6=RS_1030._col0(Inner),Output:["_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col15","_col16","_col17","_col18","_col19","_col24","_col25"]
                                                                   <-Map 42 [SIMPLE_EDGE] vectorized
                                                                     SHUFFLE [RS_1030]
@@ -446,7 +446,7 @@ Stage-0
                                                                   <-Reducer 6 [SIMPLE_EDGE]
                                                                     SHUFFLE [RS_63]
                                                                       PartitionCols:_col6
-                                                                      Merge Join Operator [MERGEJOIN_952] (rows=66897622 width=276)
+                                                                      Merge Join Operator [MERGEJOIN_952] (rows=20714426 width=160)
                                                                         Conds:RS_60._col1, _col7=RS_1026._col0, _col1(Inner),Output:["_col3","_col4","_col5","_col6","_col8","_col9","_col10","_col11","_col15","_col16","_col17","_col18","_col19"]
                                                                       <-Map 41 [SIMPLE_EDGE] vectorized
                                                                         SHUFFLE [RS_1026]
@@ -458,7 +458,7 @@ Stage-0
                                                                       <-Reducer 5 [SIMPLE_EDGE]
                                                                         SHUFFLE [RS_60]
                                                                           PartitionCols:_col1, _col7
-                                                                          Merge Join Operator [MERGEJOIN_951] (rows=40575792 width=220)
+                                                                          Merge Join Operator [MERGEJOIN_951] (rows=12564038 width=28)
                                                                             Conds:RS_57._col1=RS_1024._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col15","_col16","_col17","_col18","_col19"]
                                                                           <-Reducer 37 [SIMPLE_EDGE] vectorized
                                                                             SHUFFLE [RS_1024]
@@ -511,7 +511,7 @@ Stage-0
                                                                           <-Reducer 4 [SIMPLE_EDGE]
                                                                             SHUFFLE [RS_57]
                                                                               PartitionCols:_col1
-                                                                              Merge Join Operator [MERGEJOIN_949] (rows=40575792 width=220)
+                                                                              Merge Join Operator [MERGEJOIN_949] (rows=12564038 width=28)
                                                                                 Conds:RS_54._col2=RS_1011._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col15","_col16","_col17","_col18","_col19"]
                                                                               <-Map 21 [SIMPLE_EDGE] vectorized
                                                                                 SHUFFLE [RS_1011]
@@ -525,7 +525,7 @@ Stage-0
                                                                               <-Reducer 3 [SIMPLE_EDGE]
                                                                                 SHUFFLE [RS_54]
                                                                                   PartitionCols:_col2
-                                                                                  Merge Join Operator [MERGEJOIN_948] (rows=40575792 width=203)
+                                                                                  Merge Join Operator [MERGEJOIN_948] (rows=14487982 width=12)
                                                                                     Conds:RS_51._col0=RS_990._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11"]
                                                                                   <-Map 44 [SIMPLE_EDGE] vectorized
                                                                                     PARTITION_ONLY_SHUFFLE [RS_990]
@@ -567,20 +567,20 @@ Stage-0
                 <-Reducer 34 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_1077]
                     PartitionCols:_col2, _col1, _col3
-                    Select Operator [SEL_1076] (rows=68803026 width=1354)
+                    Select Operator [SEL_1076] (rows=21304422 width=1354)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
-                      Filter Operator [FIL_1075] (rows=68803026 width=1362)
+                      Filter Operator [FIL_1075] (rows=21304422 width=1362)
                         predicate:_col14 is not null
-                        Select Operator [SEL_1074] (rows=68803026 width=1362)
+                        Select Operator [SEL_1074] (rows=21304422 width=1362)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col14","_col15","_col16","_col17"]
-                          Group By Operator [GBY_1073] (rows=68803026 width=1362)
+                          Group By Operator [GBY_1073] (rows=21304422 width=1362)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17"],aggregations:["count(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7, KEY._col8, KEY._col9, KEY._col10, KEY._col11, KEY._col12, KEY._col13
                           <-Reducer 33 [SIMPLE_EDGE]
                             SHUFFLE [RS_191]
                               PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13
-                              Group By Operator [GBY_190] (rows=68803026 width=1362)
+                              Group By Operator [GBY_190] (rows=21304422 width=1362)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17"],aggregations:["count()","sum(_col8)","sum(_col9)","sum(_col10)"],keys:_col24, _col11, _col25, _col12, _col29, _col31, _col37, _col38, _col39, _col40, _col42, _col43, _col44, _col45
-                                Merge Join Operator [MERGEJOIN_976] (rows=68803026 width=1262)
+                                Merge Join Operator [MERGEJOIN_976] (rows=21304422 width=1155)
                                   Conds:RS_186._col17=RS_1047._col0(Inner),Output:["_col8","_col9","_col10","_col11","_col12","_col24","_col25","_col29","_col31","_col37","_col38","_col39","_col40","_col42","_col43","_col44","_col45"]
                                 <-Map 49 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_1047]
@@ -589,7 +589,7 @@ Stage-0
                                 <-Reducer 32 [SIMPLE_EDGE]
                                   SHUFFLE [RS_186]
                                     PartitionCols:_col17
-                                    Merge Join Operator [MERGEJOIN_975] (rows=68803026 width=905)
+                                    Merge Join Operator [MERGEJOIN_975] (rows=21304422 width=798)
                                       Conds:RS_183._col5=RS_1046._col0(Inner),Output:["_col8","_col9","_col10","_col11","_col12","_col17","_col24","_col25","_col29","_col31","_col37","_col38","_col39","_col40"]
                                     <-Map 49 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_1046]
@@ -598,9 +598,9 @@ Stage-0
                                     <-Reducer 31 [SIMPLE_EDGE]
                                       SHUFFLE [RS_183]
                                         PartitionCols:_col5
-                                        Filter Operator [FIL_182] (rows=68803026 width=717)
+                                        Filter Operator [FIL_182] (rows=21304422 width=609)
                                           predicate:(_col33 <> _col35)
-                                          Merge Join Operator [MERGEJOIN_974] (rows=68803026 width=717)
+                                          Merge Join Operator [MERGEJOIN_974] (rows=21304422 width=609)
                                             Conds:RS_179._col15=RS_1042._col0(Inner),Output:["_col5","_col8","_col9","_col10","_col11","_col12","_col17","_col24","_col25","_col29","_col31","_col33","_col35"]
                                           <-Map 48 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_1042]
@@ -609,7 +609,7 @@ Stage-0
                                           <-Reducer 30 [SIMPLE_EDGE]
                                             SHUFFLE [RS_179]
                                               PartitionCols:_col15
-                                              Merge Join Operator [MERGEJOIN_973] (rows=67843635 width=634)
+                                              Merge Join Operator [MERGEJOIN_973] (rows=21007353 width=525)
                                                 Conds:RS_176._col3=RS_1041._col0(Inner),Output:["_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col17","_col24","_col25","_col29","_col31","_col33"]
                                               <-Map 48 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_1041]
@@ -618,7 +618,7 @@ Stage-0
                                               <-Reducer 29 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_176]
                                                   PartitionCols:_col3
-                                                  Merge Join Operator [MERGEJOIN_972] (rows=66897622 width=551)
+                                                  Merge Join Operator [MERGEJOIN_972] (rows=20714426 width=438)
                                                     Conds:RS_173._col18=RS_988._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col17","_col24","_col25","_col29","_col31"]
                                                   <-Map 44 [SIMPLE_EDGE] vectorized
                                                     PARTITION_ONLY_SHUFFLE [RS_988]
@@ -629,7 +629,7 @@ Stage-0
                                                   <-Reducer 28 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_173]
                                                       PartitionCols:_col18
-                                                      Merge Join Operator [MERGEJOIN_971] (rows=66897622 width=551)
+                                                      Merge Join Operator [MERGEJOIN_971] (rows=20714426 width=438)
                                                         Conds:RS_170._col19=RS_987._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col17","_col18","_col24","_col25","_col29"]
                                                       <-Map 44 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_987]
@@ -640,7 +640,7 @@ Stage-0
                                                       <-Reducer 27 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_170]
                                                           PartitionCols:_col19
-                                                          Merge Join Operator [MERGEJOIN_970] (rows=66897622 width=551)
+                                                          Merge Join Operator [MERGEJOIN_970] (rows=20714426 width=437)
                                                             Conds:RS_167._col16=RS_1037._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col17","_col18","_col19","_col24","_col25"]
                                                           <-Map 43 [SIMPLE_EDGE] vectorized
                                                             SHUFFLE [RS_1037]
@@ -649,7 +649,7 @@ Stage-0
                                                           <-Reducer 26 [SIMPLE_EDGE]
                                                             SHUFFLE [RS_167]
                                                               PartitionCols:_col16
-                                                              Merge Join Operator [MERGEJOIN_969] (rows=66897622 width=554)
+                                                              Merge Join Operator [MERGEJOIN_969] (rows=20714426 width=441)
                                                                 Conds:RS_164._col4=RS_1036._col0(Inner),Output:["_col3","_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17","_col18","_col19","_col24","_col25"]
                                                               <-Map 43 [SIMPLE_EDGE] vectorized
                                                                 SHUFFLE [RS_1036]
@@ -658,7 +658,7 @@ Stage-0
                                                               <-Reducer 25 [SIMPLE_EDGE]
                                                                 SHUFFLE [RS_164]
                                                                   PartitionCols:_col4
-                                                                  Merge Join Operator [MERGEJOIN_968] (rows=66897622 width=557)
+                                                                  Merge Join Operator [MERGEJOIN_968] (rows=20714426 width=443)
                                                                     Conds:RS_161._col6=RS_1031._col0(Inner),Output:["_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17","_col18","_col19","_col24","_col25"]
                                                                   <-Map 42 [SIMPLE_EDGE] vectorized
                                                                     SHUFFLE [RS_1031]
@@ -667,7 +667,7 @@ Stage-0
                                                                   <-Reducer 24 [SIMPLE_EDGE]
                                                                     SHUFFLE [RS_161]
                                                                       PartitionCols:_col6
-                                                                      Merge Join Operator [MERGEJOIN_967] (rows=66897622 width=383)
+                                                                      Merge Join Operator [MERGEJOIN_967] (rows=20714426 width=267)
                                                                         Conds:RS_158._col1, _col7=RS_1027._col0, _col1(Inner),Output:["_col3","_col4","_col5","_col6","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17","_col18","_col19"]
                                                                       <-Map 41 [SIMPLE_EDGE] vectorized
                                                                         SHUFFLE [RS_1027]
@@ -676,12 +676,12 @@ Stage-0
                                                                       <-Reducer 23 [SIMPLE_EDGE]
                                                                         SHUFFLE [RS_158]
                                                                           PartitionCols:_col1, _col7
-                                                                          Merge Join Operator [MERGEJOIN_966] (rows=40575792 width=327)
+                                                                          Merge Join Operator [MERGEJOIN_966] (rows=12564038 width=135)
                                                                             Conds:RS_155._col1=RS_1072._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17","_col18","_col19"]
                                                                           <-Reducer 22 [SIMPLE_EDGE]
                                                                             SHUFFLE [RS_155]
                                                                               PartitionCols:_col1
-                                                                              Merge Join Operator [MERGEJOIN_964] (rows=40575792 width=327)
+                                                                              Merge Join Operator [MERGEJOIN_964] (rows=12564038 width=135)
                                                                                 Conds:RS_152._col2=RS_1012._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col15","_col16","_col17","_col18","_col19"]
                                                                               <-Map 21 [SIMPLE_EDGE] vectorized
                                                                                 SHUFFLE [RS_1012]
@@ -690,7 +690,7 @@ Stage-0
                                                                               <-Reducer 46 [SIMPLE_EDGE]
                                                                                 SHUFFLE [RS_152]
                                                                                   PartitionCols:_col2
-                                                                                  Merge Join Operator [MERGEJOIN_963] (rows=40575792 width=310)
+                                                                                  Merge Join Operator [MERGEJOIN_963] (rows=14487982 width=119)
                                                                                     Conds:RS_149._col0=RS_992._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
                                                                                   <-Map 44 [SIMPLE_EDGE] vectorized
                                                                                     PARTITION_ONLY_SHUFFLE [RS_992]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query65.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query65.q.out
index 4582eb6..0bc7aae 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query65.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query65.q.out
@@ -83,17 +83,17 @@ Stage-0
     Stage-1
       Reducer 7 vectorized
       File Output Operator [FS_165]
-        Limit [LIM_164] (rows=100 width=708)
+        Limit [LIM_164] (rows=100 width=702)
           Number of rows:100
-          Select Operator [SEL_163] (rows=1772841 width=707)
+          Select Operator [SEL_163] (rows=65392 width=700)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 6 [SIMPLE_EDGE]
             SHUFFLE [RS_51]
-              Select Operator [SEL_50] (rows=1772841 width=707)
+              Select Operator [SEL_50] (rows=65392 width=700)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                Top N Key Operator [TNK_80] (rows=1772841 width=707)
+                Top N Key Operator [TNK_80] (rows=65392 width=704)
                   keys:_col6, _col8,top n:100
-                  Merge Join Operator [MERGEJOIN_138] (rows=1772841 width=707)
+                  Merge Join Operator [MERGEJOIN_138] (rows=65392 width=704)
                     Conds:RS_47._col1=RS_162._col0(Inner),Output:["_col2","_col6","_col8","_col9","_col10","_col11"]
                   <-Map 12 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_162]
@@ -105,7 +105,7 @@ Stage-0
                   <-Reducer 5 [SIMPLE_EDGE]
                     SHUFFLE [RS_47]
                       PartitionCols:_col1
-                      Merge Join Operator [MERGEJOIN_137] (rows=1772841 width=204)
+                      Merge Join Operator [MERGEJOIN_137] (rows=65392 width=204)
                         Conds:RS_44._col0=RS_160._col0(Inner),Output:["_col1","_col2","_col6"]
                       <-Map 11 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_160]
@@ -117,23 +117,23 @@ Stage-0
                       <-Reducer 4 [SIMPLE_EDGE]
                         SHUFFLE [RS_44]
                           PartitionCols:_col0
-                          Filter Operator [FIL_43] (rows=1772841 width=231)
+                          Filter Operator [FIL_43] (rows=65392 width=231)
                             predicate:(_col2 <= _col4)
-                            Merge Join Operator [MERGEJOIN_136] (rows=5318523 width=231)
+                            Merge Join Operator [MERGEJOIN_136] (rows=196176 width=231)
                               Conds:RS_152._col0=RS_158._col0(Inner),Output:["_col0","_col1","_col2","_col4"]
                             <-Reducer 3 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_152]
                                 PartitionCols:_col0
-                                Filter Operator [FIL_151] (rows=5255208 width=119)
+                                Filter Operator [FIL_151] (rows=184637 width=118)
                                   predicate:_col2 is not null
-                                  Group By Operator [GBY_150] (rows=5255208 width=119)
+                                  Group By Operator [GBY_150] (rows=184637 width=118)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_11]
                                       PartitionCols:_col0, _col1
-                                      Group By Operator [GBY_10] (rows=525329897 width=119)
+                                      Group By Operator [GBY_10] (rows=6093021 width=118)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                        Merge Join Operator [MERGEJOIN_134] (rows=525329897 width=114)
+                                        Merge Join Operator [MERGEJOIN_134] (rows=91197860 width=89)
                                           Conds:RS_149._col0=RS_141._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 9 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_141]
@@ -167,15 +167,15 @@ Stage-0
                             <-Reducer 8 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_158]
                                 PartitionCols:_col0
-                                Select Operator [SEL_157] (rows=84 width=115)
+                                Select Operator [SEL_157] (rows=17 width=115)
                                   Output:["_col0","_col1"]
-                                  Filter Operator [FIL_156] (rows=84 width=123)
+                                  Filter Operator [FIL_156] (rows=17 width=123)
                                     predicate:CAST( (_col1 / _col2) AS decimal(21,6)) is not null
-                                    Group By Operator [GBY_155] (rows=84 width=123)
+                                    Group By Operator [GBY_155] (rows=17 width=123)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)","count(_col2)"],keys:_col1
-                                      Select Operator [SEL_154] (rows=5255208 width=119)
+                                      Select Operator [SEL_154] (rows=184637 width=118)
                                         Output:["_col1","_col2"]
-                                        Group By Operator [GBY_153] (rows=5255208 width=119)
+                                        Group By Operator [GBY_153] (rows=184637 width=118)
                                           Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                         <-Reducer 2 [SIMPLE_EDGE]
                                           SHUFFLE [RS_27]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query66.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query66.q.out
index a27a358..2917b8c 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query66.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query66.q.out
@@ -505,11 +505,11 @@ Stage-0
                             <-Reducer 14 [SIMPLE_EDGE]
                               SHUFFLE [RS_61]
                                 PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                Group By Operator [GBY_60] (rows=15681803 width=3166)
+                                Group By Operator [GBY_60] (rows=12905590 width=3166)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20","_col21","_col22","_col23","_col24","_col25","_col26","_col27","_col28","_col29"],aggregations:["sum(_col6)","sum(_col7)","sum(_col8)","sum(_col9)","sum(_col10)","sum(_col11)","sum(_col12)","sum(_col13)","sum(_col14)","sum(_col15)","sum(_col16)","sum(_col17)","sum(_col18 [...]
-                                  Select Operator [SEL_58] (rows=15681803 width=750)
+                                  Select Operator [SEL_58] (rows=12905590 width=750)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20","_col21","_col22","_col23","_col24","_col25","_col26","_col27","_col28","_col29"]
-                                    Merge Join Operator [MERGEJOIN_207] (rows=15681803 width=750)
+                                    Merge Join Operator [MERGEJOIN_207] (rows=12905590 width=750)
                                       Conds:RS_55._col3=RS_245._col0(Inner),Output:["_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col22","_col23","_col24","_col25","_col26","_col27"]
                                     <-Map 20 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_245]
@@ -521,7 +521,7 @@ Stage-0
                                     <-Reducer 13 [SIMPLE_EDGE]
                                       SHUFFLE [RS_55]
                                         PartitionCols:_col3
-                                        Merge Join Operator [MERGEJOIN_206] (rows=15681803 width=275)
+                                        Merge Join Operator [MERGEJOIN_206] (rows=12905590 width=275)
                                           Conds:RS_52._col2=RS_224._col0(Inner),Output:["_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_224]
@@ -535,7 +535,7 @@ Stage-0
                                         <-Reducer 12 [SIMPLE_EDGE]
                                           SHUFFLE [RS_52]
                                             PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_205] (rows=282272460 width=279)
+                                            Merge Join Operator [MERGEJOIN_205] (rows=38716771 width=279)
                                               Conds:RS_49._col0=RS_242._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19"]
                                             <-Map 16 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_242]
@@ -549,7 +549,7 @@ Stage-0
                                             <-Reducer 11 [SIMPLE_EDGE]
                                               SHUFFLE [RS_49]
                                                 PartitionCols:_col0
-                                                Merge Join Operator [MERGEJOIN_204] (rows=282272460 width=235)
+                                                Merge Join Operator [MERGEJOIN_204] (rows=109204159 width=235)
                                                   Conds:RS_261._col1=RS_238._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"]
                                                 <-Map 10 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_238]
@@ -596,9 +596,9 @@ Stage-0
                                 PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
                                 Group By Operator [GBY_28] (rows=27 width=3166)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20","_col21","_col22","_col23","_col24","_col25","_col26","_col27","_col28","_col29"],aggregations:["sum(_col6)","sum(_col7)","sum(_col8)","sum(_col9)","sum(_col10)","sum(_col11)","sum(_col12)","sum(_col13)","sum(_col14)","sum(_col15)","sum(_col16)","sum(_col17)","sum(_col18 [...]
-                                  Select Operator [SEL_26] (rows=7992175 width=750)
+                                  Select Operator [SEL_26] (rows=6624114 width=750)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20","_col21","_col22","_col23","_col24","_col25","_col26","_col27","_col28","_col29"]
-                                    Merge Join Operator [MERGEJOIN_203] (rows=7992175 width=750)
+                                    Merge Join Operator [MERGEJOIN_203] (rows=6624114 width=750)
                                       Conds:RS_23._col3=RS_244._col0(Inner),Output:["_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col22","_col23","_col24","_col25","_col26","_col27"]
                                     <-Map 20 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_244]
@@ -607,7 +607,7 @@ Stage-0
                                     <-Reducer 4 [SIMPLE_EDGE]
                                       SHUFFLE [RS_23]
                                         PartitionCols:_col3
-                                        Merge Join Operator [MERGEJOIN_202] (rows=7992175 width=275)
+                                        Merge Join Operator [MERGEJOIN_202] (rows=6624114 width=275)
                                           Conds:RS_20._col2=RS_222._col0(Inner),Output:["_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19"]
                                         <-Map 17 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_222]
@@ -616,7 +616,7 @@ Stage-0
                                         <-Reducer 3 [SIMPLE_EDGE]
                                           SHUFFLE [RS_20]
                                             PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_201] (rows=143859154 width=279)
+                                            Merge Join Operator [MERGEJOIN_201] (rows=19872342 width=279)
                                               Conds:RS_17._col0=RS_241._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19"]
                                             <-Map 16 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_241]
@@ -625,7 +625,7 @@ Stage-0
                                             <-Reducer 2 [SIMPLE_EDGE]
                                               SHUFFLE [RS_17]
                                                 PartitionCols:_col0
-                                                Merge Join Operator [MERGEJOIN_200] (rows=143859154 width=235)
+                                                Merge Join Operator [MERGEJOIN_200] (rows=55655511 width=235)
                                                   Conds:RS_234._col1=RS_237._col0(Inner),Output:["_col0","_col2","_col3","_col4","_col5"]
                                                 <-Map 10 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_237]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query67.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query67.q.out
index f5fe4b0..7003fc2 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query67.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query67.q.out
@@ -114,35 +114,35 @@ Stage-0
       File Output Operator [FS_111]
         Limit [LIM_110] (rows=100 width=617)
           Number of rows:100
-          Select Operator [SEL_109] (rows=1575989691 width=617)
+          Select Operator [SEL_109] (rows=273593580 width=617)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_108]
-              Select Operator [SEL_107] (rows=1575989691 width=617)
+              Select Operator [SEL_107] (rows=273593580 width=617)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                Top N Key Operator [TNK_106] (rows=1575989691 width=613)
+                Top N Key Operator [TNK_106] (rows=273593580 width=613)
                   keys:_col6, _col5, _col4, _col7, _col0, _col2, _col1, _col3, _col8, rank_window_0,top n:100
-                  Filter Operator [FIL_105] (rows=1575989691 width=613)
+                  Filter Operator [FIL_105] (rows=273593580 width=613)
                     predicate:(rank_window_0 <= 100)
-                    PTF Operator [PTF_104] (rows=4727969073 width=613)
+                    PTF Operator [PTF_104] (rows=820780740 width=613)
                       Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col8 DESC NULLS LAST","partition by:":"_col6"}]
-                      Select Operator [SEL_103] (rows=4727969073 width=613)
+                      Select Operator [SEL_103] (rows=820780740 width=613)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
                       <-Reducer 5 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_102]
                           PartitionCols:_col6
-                          Select Operator [SEL_101] (rows=4727969073 width=613)
+                          Select Operator [SEL_101] (rows=820780740 width=613)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
-                            Top N Key Operator [TNK_100] (rows=4727969073 width=621)
+                            Top N Key Operator [TNK_100] (rows=820780740 width=621)
                               PartitionCols:_col6,keys:_col6, _col9,top n:101
-                              Group By Operator [GBY_99] (rows=4727969073 width=621)
+                              Group By Operator [GBY_99] (rows=820780740 width=621)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col9"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5, KEY._col6, KEY._col7, KEY._col8
                               <-Reducer 4 [SIMPLE_EDGE]
                                 SHUFFLE [RS_21]
                                   PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8
-                                  Group By Operator [GBY_20] (rows=4727969073 width=621)
+                                  Group By Operator [GBY_20] (rows=820780740 width=621)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col7, _col9, _col11, _col12, _col13, _col14, 0L
-                                    Merge Join Operator [MERGEJOIN_83] (rows=525329897 width=613)
+                                    Merge Join Operator [MERGEJOIN_83] (rows=91197860 width=613)
                                       Conds:RS_16._col1=RS_98._col0(Inner),Output:["_col3","_col5","_col6","_col7","_col9","_col11","_col12","_col13","_col14"]
                                     <-Map 11 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_98]
@@ -154,7 +154,7 @@ Stage-0
                                     <-Reducer 3 [SIMPLE_EDGE]
                                       SHUFFLE [RS_16]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_82] (rows=525329897 width=228)
+                                        Merge Join Operator [MERGEJOIN_82] (rows=91197860 width=228)
                                           Conds:RS_13._col2=RS_96._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col9"]
                                         <-Map 10 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_96]
@@ -166,7 +166,7 @@ Stage-0
                                         <-Reducer 2 [SIMPLE_EDGE]
                                           SHUFFLE [RS_13]
                                             PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_81] (rows=525329897 width=131)
+                                            Merge Join Operator [MERGEJOIN_81] (rows=91197860 width=130)
                                               Conds:RS_94._col0=RS_86._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7"]
                                             <-Map 8 [SIMPLE_EDGE] vectorized
                                               PARTITION_ONLY_SHUFFLE [RS_86]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query68.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query68.q.out
index e07b195..018d316 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query68.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query68.q.out
@@ -116,17 +116,17 @@ Stage-0
       File Output Operator [FS_173]
         Limit [LIM_172] (rows=100 width=706)
           Number of rows:100
-          Select Operator [SEL_171] (rows=457565061 width=706)
+          Select Operator [SEL_171] (rows=727776 width=706)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
           <-Reducer 3 [SIMPLE_EDGE]
             SHUFFLE [RS_44]
-              Select Operator [SEL_43] (rows=457565061 width=706)
+              Select Operator [SEL_43] (rows=727776 width=706)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                Top N Key Operator [TNK_78] (rows=457565061 width=706)
+                Top N Key Operator [TNK_78] (rows=727776 width=706)
                   keys:_col3, _col6,top n:100
-                  Filter Operator [FIL_42] (rows=457565061 width=706)
+                  Filter Operator [FIL_42] (rows=727776 width=706)
                     predicate:(_col5 <> _col8)
-                    Merge Join Operator [MERGEJOIN_144] (rows=457565061 width=706)
+                    Merge Join Operator [MERGEJOIN_144] (rows=727776 width=706)
                       Conds:RS_39._col0=RS_170._col1(Inner),Output:["_col2","_col3","_col5","_col6","_col8","_col9","_col10","_col11"]
                     <-Reducer 2 [SIMPLE_EDGE]
                       SHUFFLE [RS_39]
@@ -152,16 +152,16 @@ Stage-0
                     <-Reducer 7 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_170]
                         PartitionCols:_col1
-                        Select Operator [SEL_169] (rows=457565061 width=436)
+                        Select Operator [SEL_169] (rows=727776 width=433)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                          Group By Operator [GBY_168] (rows=457565061 width=440)
+                          Group By Operator [GBY_168] (rows=727776 width=433)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
                           <-Reducer 6 [SIMPLE_EDGE]
                             SHUFFLE [RS_33]
                               PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_32] (rows=457565061 width=440)
+                              Group By Operator [GBY_32] (rows=727776 width=433)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col6)","sum(_col7)","sum(_col8)"],keys:_col1, _col13, _col3, _col5
-                                Merge Join Operator [MERGEJOIN_143] (rows=457565061 width=425)
+                                Merge Join Operator [MERGEJOIN_143] (rows=727776 width=97)
                                   Conds:RS_28._col3=RS_150._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col8","_col13"]
                                 <-Map 5 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_150]
@@ -170,7 +170,7 @@ Stage-0
                                 <-Reducer 11 [SIMPLE_EDGE]
                                   SHUFFLE [RS_28]
                                     PartitionCols:_col3
-                                    Merge Join Operator [MERGEJOIN_142] (rows=457565061 width=332)
+                                    Merge Join Operator [MERGEJOIN_142] (rows=727776 width=4)
                                       Conds:RS_25._col2=RS_167._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col8"]
                                     <-Map 15 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_167]
@@ -184,7 +184,7 @@ Stage-0
                                     <-Reducer 10 [SIMPLE_EDGE]
                                       SHUFFLE [RS_25]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_141] (rows=457565061 width=336)
+                                        Merge Join Operator [MERGEJOIN_141] (rows=2824787 width=4)
                                           Conds:RS_22._col4=RS_164._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7","_col8"]
                                         <-Map 14 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_164]
@@ -198,7 +198,7 @@ Stage-0
                                         <-Reducer 9 [SIMPLE_EDGE]
                                           SHUFFLE [RS_22]
                                             PartitionCols:_col4
-                                            Merge Join Operator [MERGEJOIN_140] (rows=457565061 width=340)
+                                            Merge Join Operator [MERGEJOIN_140] (rows=42598570 width=185)
                                               Conds:RS_161._col0=RS_153._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
                                             <-Map 12 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_153]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query69.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query69.q.out
index 57d36f5..baeb53a 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query69.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query69.q.out
@@ -109,20 +109,20 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 12 <- Reducer 15 (BROADCAST_EDGE)
-Map 21 <- Reducer 18 (BROADCAST_EDGE)
+Map 13 <- Reducer 16 (BROADCAST_EDGE)
+Map 21 <- Reducer 10 (BROADCAST_EDGE)
 Map 22 <- Reducer 9 (BROADCAST_EDGE)
-Reducer 13 <- Map 12 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE)
-Reducer 15 <- Map 14 (CUSTOM_SIMPLE_EDGE)
-Reducer 16 <- Map 14 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
-Reducer 17 <- Reducer 16 (SIMPLE_EDGE)
-Reducer 18 <- Map 14 (CUSTOM_SIMPLE_EDGE)
-Reducer 19 <- Map 14 (SIMPLE_EDGE), Map 22 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 10 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 14 <- Map 13 (SIMPLE_EDGE), Map 15 (SIMPLE_EDGE)
+Reducer 16 <- Map 15 (CUSTOM_SIMPLE_EDGE)
+Reducer 17 <- Map 15 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
+Reducer 18 <- Reducer 17 (SIMPLE_EDGE)
+Reducer 19 <- Map 15 (SIMPLE_EDGE), Map 22 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
 Reducer 20 <- Reducer 19 (SIMPLE_EDGE)
-Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 17 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 14 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 18 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
 Reducer 6 <- Reducer 20 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
 Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
@@ -133,16 +133,16 @@ Stage-0
     limit:100
     Stage-1
       Reducer 8 vectorized
-      File Output Operator [FS_234]
-        Limit [LIM_233] (rows=1 width=383)
+      File Output Operator [FS_231]
+        Limit [LIM_230] (rows=1 width=383)
           Number of rows:100
-          Select Operator [SEL_232] (rows=1 width=383)
+          Select Operator [SEL_229] (rows=1 width=383)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
           <-Reducer 7 [SIMPLE_EDGE] vectorized
-            SHUFFLE [RS_231]
-              Select Operator [SEL_230] (rows=1 width=383)
+            SHUFFLE [RS_228]
+              Select Operator [SEL_227] (rows=1 width=383)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col6"]
-                Group By Operator [GBY_229] (rows=1 width=367)
+                Group By Operator [GBY_226] (rows=1 width=367)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                 <-Reducer 6 [SIMPLE_EDGE]
                   SHUFFLE [RS_68]
@@ -155,8 +155,8 @@ Stage-0
                           keys:_col6, _col7, _col8, _col9, _col10,top n:100
                           Filter Operator [FIL_65] (rows=1 width=363)
                             predicate:_col13 is null
-                            Merge Join Operator [MERGEJOIN_188] (rows=1401496 width=363)
-                              Conds:RS_62._col0=RS_228._col1(Left Outer),Output:["_col6","_col7","_col8","_col9","_col10","_col13"]
+                            Merge Join Operator [MERGEJOIN_188] (rows=115467 width=363)
+                              Conds:RS_62._col0=RS_225._col1(Left Outer),Output:["_col6","_col7","_col8","_col9","_col10","_col13"]
                             <-Reducer 5 [SIMPLE_EDGE]
                               PARTITION_ONLY_SHUFFLE [RS_62]
                                 PartitionCols:_col0
@@ -164,85 +164,47 @@ Stage-0
                                   Output:["_col0","_col6","_col7","_col8","_col9","_col10"]
                                   Filter Operator [FIL_46] (rows=1 width=367)
                                     predicate:_col11 is null
-                                    Merge Join Operator [MERGEJOIN_187] (rows=1414922 width=367)
-                                      Conds:RS_43._col0=RS_220._col1(Left Outer),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11"]
-                                    <-Reducer 17 [SIMPLE_EDGE] vectorized
-                                      SHUFFLE [RS_220]
-                                        PartitionCols:_col1
-                                        Select Operator [SEL_219] (rows=1414922 width=7)
-                                          Output:["_col0","_col1"]
-                                          Group By Operator [GBY_218] (rows=1414922 width=3)
-                                            Output:["_col0"],keys:KEY._col0
-                                          <-Reducer 16 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_29]
-                                              PartitionCols:_col0
-                                              Group By Operator [GBY_28] (rows=143930993 width=3)
-                                                Output:["_col0"],keys:_col1
-                                                Merge Join Operator [MERGEJOIN_184] (rows=143930993 width=3)
-                                                  Conds:RS_217._col0=RS_201._col0(Inner),Output:["_col1"]
-                                                <-Map 14 [SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_201]
-                                                    PartitionCols:_col0
-                                                    Select Operator [SEL_198] (rows=150 width=4)
-                                                      Output:["_col0"]
-                                                      Filter Operator [FIL_197] (rows=150 width=12)
-                                                        predicate:((d_year = 1999) and d_moy BETWEEN 1 AND 3)
-                                                        TableScan [TS_11] (rows=73049 width=12)
-                                                          default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
-                                                <-Map 21 [SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_217]
-                                                    PartitionCols:_col0
-                                                    Select Operator [SEL_216] (rows=143930993 width=7)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_215] (rows=143930993 width=7)
-                                                        predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_sold_date_sk BETWEEN DynamicValue(RS_25_date_dim_d_date_sk_min) AND DynamicValue(RS_25_date_dim_d_date_sk_max) and in_bloom_filter(ws_sold_date_sk, DynamicValue(RS_25_date_dim_d_date_sk_bloom_filter)))
-                                                        TableScan [TS_18] (rows=144002668 width=7)
-                                                          default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk"]
-                                                        <-Reducer 18 [BROADCAST_EDGE] vectorized
-                                                          BROADCAST [RS_214]
-                                                            Group By Operator [GBY_213] (rows=1 width=12)
-                                                              Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                            <-Map 14 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                              SHUFFLE [RS_207]
-                                                                Group By Operator [GBY_205] (rows=1 width=12)
-                                                                  Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                                  Select Operator [SEL_202] (rows=150 width=4)
-                                                                    Output:["_col0"]
-                                                                     Please refer to the previous Select Operator [SEL_198]
+                                    Merge Join Operator [MERGEJOIN_187] (rows=116289 width=367)
+                                      Conds:RS_43._col0=RS_217._col1(Left Outer),Output:["_col0","_col6","_col7","_col8","_col9","_col10","_col11"]
                                     <-Reducer 4 [SIMPLE_EDGE]
                                       SHUFFLE [RS_43]
                                         PartitionCols:_col0
-                                        Merge Join Operator [MERGEJOIN_186] (rows=525327388 width=363)
+                                        Merge Join Operator [MERGEJOIN_186] (rows=6841 width=363)
                                           Conds:RS_40._col0=RS_41._col0(Left Semi),Output:["_col0","_col6","_col7","_col8","_col9","_col10"]
-                                        <-Reducer 13 [SIMPLE_EDGE]
+                                        <-Reducer 14 [SIMPLE_EDGE]
                                           SHUFFLE [RS_41]
                                             PartitionCols:_col0
-                                            Group By Operator [GBY_39] (rows=525327388 width=3)
+                                            Group By Operator [GBY_39] (rows=116289 width=1)
                                               Output:["_col0"],keys:_col0
-                                              Select Operator [SEL_17] (rows=525327388 width=3)
+                                              Select Operator [SEL_17] (rows=43153353 width=1)
                                                 Output:["_col0"]
-                                                Merge Join Operator [MERGEJOIN_183] (rows=525327388 width=3)
-                                                  Conds:RS_212._col0=RS_199._col0(Inner),Output:["_col1"]
-                                                <-Map 14 [SIMPLE_EDGE] vectorized
+                                                Merge Join Operator [MERGEJOIN_183] (rows=43153353 width=1)
+                                                  Conds:RS_209._col0=RS_199._col0(Inner),Output:["_col1"]
+                                                <-Map 15 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_199]
                                                     PartitionCols:_col0
-                                                     Please refer to the previous Select Operator [SEL_198]
-                                                <-Map 12 [SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_212]
+                                                    Select Operator [SEL_198] (rows=150 width=4)
+                                                      Output:["_col0"]
+                                                      Filter Operator [FIL_197] (rows=150 width=12)
+                                                        predicate:((d_year = 1999) and d_moy BETWEEN 1 AND 3)
+                                                        TableScan [TS_11] (rows=73049 width=12)
+                                                          default@date_dim,date_dim,Tbl:COMPLETE,Col:COMPLETE,Output:["d_date_sk","d_year","d_moy"]
+                                                <-Map 13 [SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_209]
                                                     PartitionCols:_col0
-                                                    Select Operator [SEL_211] (rows=525327388 width=7)
+                                                    Select Operator [SEL_208] (rows=525327388 width=7)
                                                       Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_210] (rows=525327388 width=7)
+                                                      Filter Operator [FIL_207] (rows=525327388 width=7)
                                                         predicate:(ss_sold_date_sk is not null and ss_customer_sk is not null and ss_sold_date_sk BETWEEN DynamicValue(RS_15_date_dim_d_date_sk_min) AND DynamicValue(RS_15_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_15_date_dim_d_date_sk_bloom_filter)))
                                                         TableScan [TS_8] (rows=575995635 width=7)
                                                           default@store_sales,store_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ss_sold_date_sk","ss_customer_sk"]
-                                                        <-Reducer 15 [BROADCAST_EDGE] vectorized
-                                                          BROADCAST [RS_209]
-                                                            Group By Operator [GBY_208] (rows=1 width=12)
+                                                        <-Reducer 16 [BROADCAST_EDGE] vectorized
+                                                          BROADCAST [RS_206]
+                                                            Group By Operator [GBY_205] (rows=1 width=12)
                                                               Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                            <-Map 14 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                              SHUFFLE [RS_206]
-                                                                Group By Operator [GBY_204] (rows=1 width=12)
+                                                            <-Map 15 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                              SHUFFLE [RS_204]
+                                                                Group By Operator [GBY_203] (rows=1 width=12)
                                                                   Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
                                                                   Select Operator [SEL_200] (rows=150 width=4)
                                                                     Output:["_col0"]
@@ -252,7 +214,7 @@ Stage-0
                                             PartitionCols:_col0
                                             Merge Join Operator [MERGEJOIN_182] (rows=4605476 width=363)
                                               Conds:RS_35._col1=RS_196._col0(Inner),Output:["_col0","_col6","_col7","_col8","_col9","_col10"]
-                                            <-Map 11 [SIMPLE_EDGE] vectorized
+                                            <-Map 12 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_196]
                                                 PartitionCols:_col0
                                                 Select Operator [SEL_195] (rows=1861800 width=363)
@@ -273,7 +235,7 @@ Stage-0
                                                         predicate:(c_current_cdemo_sk is not null and c_current_addr_sk is not null)
                                                         TableScan [TS_0] (rows=80000000 width=11)
                                                           default@customer,c,Tbl:COMPLETE,Col:COMPLETE,Output:["c_customer_sk","c_current_cdemo_sk","c_current_addr_sk"]
-                                                <-Map 10 [SIMPLE_EDGE] vectorized
+                                                <-Map 11 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_194]
                                                     PartitionCols:_col0
                                                     Select Operator [SEL_193] (rows=2352941 width=90)
@@ -282,36 +244,74 @@ Stage-0
                                                         predicate:(ca_state) IN ('CO', 'IL', 'MN')
                                                         TableScan [TS_3] (rows=40000000 width=90)
                                                           default@customer_address,ca,Tbl:COMPLETE,Col:COMPLETE,Output:["ca_address_sk","ca_state"]
+                                    <-Reducer 18 [SIMPLE_EDGE] vectorized
+                                      SHUFFLE [RS_217]
+                                        PartitionCols:_col1
+                                        Select Operator [SEL_216] (rows=116289 width=7)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_215] (rows=116289 width=3)
+                                            Output:["_col0"],keys:KEY._col0
+                                          <-Reducer 17 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_29]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_28] (rows=116289 width=3)
+                                                Output:["_col0"],keys:_col1
+                                                Merge Join Operator [MERGEJOIN_184] (rows=11823304 width=3)
+                                                  Conds:RS_214._col0=RS_201._col0(Inner),Output:["_col1"]
+                                                <-Map 15 [SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_201]
+                                                    PartitionCols:_col0
+                                                     Please refer to the previous Select Operator [SEL_198]
+                                                <-Map 21 [SIMPLE_EDGE] vectorized
+                                                  SHUFFLE [RS_214]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_213] (rows=143930993 width=7)
+                                                      Output:["_col0","_col1"]
+                                                      Filter Operator [FIL_212] (rows=143930993 width=7)
+                                                        predicate:(ws_bill_customer_sk is not null and ws_sold_date_sk is not null and ws_bill_customer_sk BETWEEN DynamicValue(RS_43_c_c_customer_sk_min) AND DynamicValue(RS_43_c_c_customer_sk_max) and in_bloom_filter(ws_bill_customer_sk, DynamicValue(RS_43_c_c_customer_sk_bloom_filter)))
+                                                        TableScan [TS_18] (rows=144002668 width=7)
+                                                          default@web_sales,web_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["ws_sold_date_sk","ws_bill_customer_sk"]
+                                                        <-Reducer 10 [BROADCAST_EDGE] vectorized
+                                                          BROADCAST [RS_211]
+                                                            Group By Operator [GBY_210] (rows=1 width=12)
+                                                              Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                            <-Reducer 4 [CUSTOM_SIMPLE_EDGE]
+                                                              SHUFFLE [RS_157]
+                                                                Group By Operator [GBY_156] (rows=1 width=12)
+                                                                  Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                                  Select Operator [SEL_155] (rows=6841 width=4)
+                                                                    Output:["_col0"]
+                                                                     Please refer to the previous Merge Join Operator [MERGEJOIN_186]
                             <-Reducer 20 [SIMPLE_EDGE] vectorized
-                              SHUFFLE [RS_228]
+                              SHUFFLE [RS_225]
                                 PartitionCols:_col1
-                                Select Operator [SEL_227] (rows=1401496 width=7)
+                                Select Operator [SEL_224] (rows=115467 width=7)
                                   Output:["_col0","_col1"]
-                                  Group By Operator [GBY_226] (rows=1401496 width=3)
+                                  Group By Operator [GBY_223] (rows=115467 width=3)
                                     Output:["_col0"],keys:KEY._col0
                                   <-Reducer 19 [SIMPLE_EDGE]
                                     SHUFFLE [RS_59]
                                       PartitionCols:_col0
-                                      Group By Operator [GBY_58] (rows=285115246 width=3)
+                                      Group By Operator [GBY_58] (rows=115467 width=3)
                                         Output:["_col0"],keys:_col1
-                                        Merge Join Operator [MERGEJOIN_185] (rows=285115246 width=3)
-                                          Conds:RS_225._col0=RS_203._col0(Inner),Output:["_col1"]
-                                        <-Map 14 [SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_203]
+                                        Merge Join Operator [MERGEJOIN_185] (rows=23255411 width=3)
+                                          Conds:RS_222._col0=RS_202._col0(Inner),Output:["_col1"]
+                                        <-Map 15 [SIMPLE_EDGE] vectorized
+                                          SHUFFLE [RS_202]
                                             PartitionCols:_col0
                                              Please refer to the previous Select Operator [SEL_198]
                                         <-Map 22 [SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_225]
+                                          SHUFFLE [RS_222]
                                             PartitionCols:_col0
-                                            Select Operator [SEL_224] (rows=285115246 width=7)
+                                            Select Operator [SEL_221] (rows=285115246 width=7)
                                               Output:["_col0","_col1"]
-                                              Filter Operator [FIL_223] (rows=285115246 width=7)
+                                              Filter Operator [FIL_220] (rows=285115246 width=7)
                                                 predicate:(cs_ship_customer_sk is not null and cs_sold_date_sk is not null and cs_ship_customer_sk BETWEEN DynamicValue(RS_62_c_c_customer_sk_min) AND DynamicValue(RS_62_c_c_customer_sk_max) and in_bloom_filter(cs_ship_customer_sk, DynamicValue(RS_62_c_c_customer_sk_bloom_filter)))
                                                 TableScan [TS_48] (rows=287989836 width=7)
                                                   default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:COMPLETE,Output:["cs_sold_date_sk","cs_ship_customer_sk"]
                                                 <-Reducer 9 [BROADCAST_EDGE] vectorized
-                                                  BROADCAST [RS_222]
-                                                    Group By Operator [GBY_221] (rows=1 width=12)
+                                                  BROADCAST [RS_219]
+                                                    Group By Operator [GBY_218] (rows=1 width=12)
                                                       Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
                                                     <-Reducer 5 [CUSTOM_SIMPLE_EDGE]
                                                       PARTITION_ONLY_SHUFFLE [RS_172]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query7.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query7.q.out
index 7dc1bf6..9dc4baa 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query7.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query7.q.out
@@ -83,9 +83,9 @@ Stage-0
                     PartitionCols:_col0
                     Group By Operator [GBY_27] (rows=462000 width=476)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"],aggregations:["sum(_col4)","count(_col4)","sum(_col5)","count(_col5)","sum(_col7)","count(_col7)","sum(_col6)","count(_col6)"],keys:_col12
-                      Top N Key Operator [TNK_57] (rows=4635977 width=100)
+                      Top N Key Operator [TNK_57] (rows=1441769 width=100)
                         keys:_col12,top n:100
-                        Merge Join Operator [MERGEJOIN_103] (rows=4635977 width=100)
+                        Merge Join Operator [MERGEJOIN_103] (rows=1441769 width=100)
                           Conds:RS_23._col1=RS_122._col0(Inner),Output:["_col4","_col5","_col6","_col7","_col12"]
                         <-Map 12 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_122]
@@ -97,7 +97,7 @@ Stage-0
                         <-Reducer 4 [SIMPLE_EDGE]
                           SHUFFLE [RS_23]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_102] (rows=4635977 width=4)
+                            Merge Join Operator [MERGEJOIN_102] (rows=1441769 width=4)
                               Conds:RS_20._col3=RS_120._col0(Inner),Output:["_col1","_col4","_col5","_col6","_col7"]
                             <-Map 11 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_120]
@@ -111,7 +111,7 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE]
                               SHUFFLE [RS_20]
                                 PartitionCols:_col3
-                                Merge Join Operator [MERGEJOIN_101] (rows=4635977 width=4)
+                                Merge Join Operator [MERGEJOIN_101] (rows=1441769 width=4)
                                   Conds:RS_17._col0=RS_117._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7"]
                                 <-Map 10 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_117]
@@ -125,7 +125,7 @@ Stage-0
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_17]
                                     PartitionCols:_col0
-                                    Merge Join Operator [MERGEJOIN_100] (rows=4635977 width=4)
+                                    Merge Join Operator [MERGEJOIN_100] (rows=4037893 width=4)
                                       Conds:RS_114._col2=RS_106._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7"]
                                     <-Map 8 [SIMPLE_EDGE] vectorized
                                       PARTITION_ONLY_SHUFFLE [RS_106]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query70.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query70.q.out
index 404ed9c..8fbedbc 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query70.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query70.q.out
@@ -125,16 +125,16 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_49]
                               PartitionCols:_col0, _col1, _col2
-                              Group By Operator [GBY_48] (rows=430560 width=304)
+                              Group By Operator [GBY_48] (rows=69120 width=304)
                                 Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)"],keys:_col0, _col1, 0L
-                                Select Operator [SEL_46] (rows=525329897 width=290)
+                                Select Operator [SEL_46] (rows=91197860 width=266)
                                   Output:["_col0","_col1","_col2"]
-                                  Merge Join Operator [MERGEJOIN_137] (rows=525329897 width=290)
+                                  Merge Join Operator [MERGEJOIN_137] (rows=91197860 width=266)
                                     Conds:RS_43._col1=RS_44._col0(Inner),Output:["_col2","_col6","_col7"]
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_43]
                                       PartitionCols:_col1
-                                      Merge Join Operator [MERGEJOIN_133] (rows=525329897 width=110)
+                                      Merge Join Operator [MERGEJOIN_133] (rows=91197860 width=85)
                                         Conds:RS_148._col0=RS_140._col0(Inner),Output:["_col1","_col2"]
                                       <-Map 11 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_140]
@@ -200,9 +200,9 @@ Stage-0
                                                       <-Reducer 7 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_26]
                                                           PartitionCols:_col0
-                                                          Group By Operator [GBY_25] (rows=19404 width=198)
+                                                          Group By Operator [GBY_25] (rows=2989 width=198)
                                                             Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col5
-                                                            Merge Join Operator [MERGEJOIN_135] (rows=525329897 width=192)
+                                                            Merge Join Operator [MERGEJOIN_135] (rows=91197860 width=168)
                                                               Conds:RS_21._col1=RS_151._col0(Inner),Output:["_col2","_col5"]
                                                             <-Reducer 2 [SIMPLE_EDGE]
                                                               SHUFFLE [RS_21]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query71.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query71.q.out
index 1238e6a..83065fd 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query71.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query71.q.out
@@ -111,20 +111,20 @@ Stage-0
     Stage-1
       Reducer 7 vectorized
       File Output Operator [FS_174]
-        Select Operator [SEL_173] (rows=145803092 width=223)
+        Select Operator [SEL_173] (rows=1991967 width=223)
           Output:["_col0","_col1","_col2","_col3","_col4"]
         <-Reducer 6 [SIMPLE_EDGE] vectorized
           SHUFFLE [RS_172]
-            Select Operator [SEL_171] (rows=145803092 width=227)
+            Select Operator [SEL_171] (rows=1991967 width=227)
               Output:["_col1","_col2","_col3","_col4","_col5"]
-              Group By Operator [GBY_170] (rows=145803092 width=223)
+              Group By Operator [GBY_170] (rows=1991967 width=223)
                 Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
               <-Reducer 5 [SIMPLE_EDGE]
                 SHUFFLE [RS_46]
                   PartitionCols:_col0, _col1, _col2, _col3
-                  Group By Operator [GBY_45] (rows=145803092 width=223)
+                  Group By Operator [GBY_45] (rows=1991967 width=223)
                     Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col0)"],keys:_col4, _col7, _col8, _col5
-                    Merge Join Operator [MERGEJOIN_140] (rows=145803092 width=204)
+                    Merge Join Operator [MERGEJOIN_140] (rows=1991967 width=112)
                       Conds:RS_41._col2=RS_169._col0(Inner),Output:["_col0","_col4","_col5","_col7","_col8"]
                     <-Map 19 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_169]
@@ -138,7 +138,7 @@ Stage-0
                     <-Reducer 4 [SIMPLE_EDGE]
                       SHUFFLE [RS_41]
                         PartitionCols:_col2
-                        Merge Join Operator [MERGEJOIN_139] (rows=145803092 width=200)
+                        Merge Join Operator [MERGEJOIN_139] (rows=3983933 width=104)
                           Conds:Union 3._col1=RS_166._col0(Inner),Output:["_col0","_col2","_col4","_col5"]
                         <-Map 18 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_166]
@@ -153,9 +153,9 @@ Stage-0
                           <-Reducer 11 [CONTAINS]
                             Reduce Output Operator [RS_148]
                               PartitionCols:_col1
-                              Select Operator [SEL_146] (rows=285116947 width=119)
+                              Select Operator [SEL_146] (rows=7751851 width=98)
                                 Output:["_col0","_col1","_col2"]
-                                Merge Join Operator [MERGEJOIN_145] (rows=285116947 width=119)
+                                Merge Join Operator [MERGEJOIN_145] (rows=7751851 width=98)
                                   Conds:RS_185._col0=RS_177._col0(Inner),Output:["_col1","_col2","_col3"]
                                 <-Map 12 [SIMPLE_EDGE] vectorized
                                   PARTITION_ONLY_SHUFFLE [RS_177]
@@ -189,9 +189,9 @@ Stage-0
                           <-Reducer 15 [CONTAINS]
                             Reduce Output Operator [RS_152]
                               PartitionCols:_col1
-                              Select Operator [SEL_150] (rows=525325345 width=114)
+                              Select Operator [SEL_150] (rows=14384397 width=4)
                                 Output:["_col0","_col1","_col2"]
-                                Merge Join Operator [MERGEJOIN_149] (rows=525325345 width=114)
+                                Merge Join Operator [MERGEJOIN_149] (rows=14384397 width=4)
                                   Conds:RS_196._col0=RS_188._col0(Inner),Output:["_col1","_col2","_col3"]
                                 <-Map 16 [SIMPLE_EDGE] vectorized
                                   PARTITION_ONLY_SHUFFLE [RS_188]
@@ -225,9 +225,9 @@ Stage-0
                           <-Reducer 2 [CONTAINS]
                             Reduce Output Operator [RS_144]
                               PartitionCols:_col1
-                              Select Operator [SEL_142] (rows=143930836 width=119)
+                              Select Operator [SEL_142] (rows=3941098 width=118)
                                 Output:["_col0","_col1","_col2"]
-                                Merge Join Operator [MERGEJOIN_141] (rows=143930836 width=119)
+                                Merge Join Operator [MERGEJOIN_141] (rows=3941098 width=118)
                                   Conds:RS_163._col0=RS_155._col0(Inner),Output:["_col1","_col2","_col3"]
                                 <-Map 8 [SIMPLE_EDGE] vectorized
                                   PARTITION_ONLY_SHUFFLE [RS_155]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query72.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query72.q.out
index 50a651a..b5fc39d 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query72.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query72.q.out
@@ -104,22 +104,22 @@ Stage-0
       File Output Operator [FS_285]
         Limit [LIM_284] (rows=100 width=312)
           Number of rows:100
-          Select Operator [SEL_283] (rows=2645646117 width=312)
+          Select Operator [SEL_283] (rows=182953402 width=312)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 11 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_282]
-              Top N Key Operator [TNK_281] (rows=2645646117 width=312)
+              Top N Key Operator [TNK_281] (rows=182953402 width=312)
                 keys:_col5, _col0, _col1, _col2,top n:100
-                Group By Operator [GBY_280] (rows=2645646117 width=312)
+                Group By Operator [GBY_280] (rows=182953402 width=312)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
                 <-Reducer 10 [SIMPLE_EDGE]
                   SHUFFLE [RS_66]
                     PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_65] (rows=2645646117 width=312)
+                    Group By Operator [GBY_65] (rows=182953402 width=312)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col3)","count(_col4)","count()"],keys:_col0, _col1, _col2
-                      Select Operator [SEL_63] (rows=6823092784 width=292)
+                      Select Operator [SEL_63] (rows=471834849 width=292)
                         Output:["_col0","_col1","_col2","_col3","_col4"]
-                        Merge Join Operator [MERGEJOIN_248] (rows=6823092784 width=292)
+                        Merge Join Operator [MERGEJOIN_248] (rows=471834849 width=292)
                           Conds:RS_60._col4, _col6=RS_279._col0, _col1(Left Outer),Output:["_col13","_col15","_col19","_col25"]
                         <-Map 24 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_279]
@@ -131,9 +131,9 @@ Stage-0
                         <-Reducer 9 [SIMPLE_EDGE]
                           SHUFFLE [RS_60]
                             PartitionCols:_col4, _col6
-                            Select Operator [SEL_57] (rows=2645646117 width=300)
+                            Select Operator [SEL_57] (rows=182953402 width=300)
                               Output:["_col4","_col6","_col13","_col15","_col19","_col25"]
-                              Merge Join Operator [MERGEJOIN_247] (rows=2645646117 width=300)
+                              Merge Join Operator [MERGEJOIN_247] (rows=182953402 width=300)
                                 Conds:RS_54._col4=RS_277._col0(Inner),Output:["_col4","_col6","_col13","_col20","_col21","_col25"]
                               <-Map 23 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_277]
@@ -145,9 +145,9 @@ Stage-0
                               <-Reducer 8 [SIMPLE_EDGE]
                                 SHUFFLE [RS_54]
                                   PartitionCols:_col4
-                                  Filter Operator [FIL_53] (rows=2645646117 width=132)
+                                  Filter Operator [FIL_53] (rows=182953402 width=132)
                                     predicate:(_col23 > _col14)
-                                    Merge Join Operator [MERGEJOIN_246] (rows=7936938353 width=132)
+                                    Merge Join Operator [MERGEJOIN_246] (rows=548860207 width=132)
                                       Conds:RS_50._col1=RS_275._col0(Inner),Output:["_col4","_col6","_col13","_col14","_col20","_col21","_col23"]
                                     <-Map 22 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_275]
@@ -161,7 +161,7 @@ Stage-0
                                     <-Reducer 7 [SIMPLE_EDGE]
                                       SHUFFLE [RS_50]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_245] (rows=7936938353 width=127)
+                                        Merge Join Operator [MERGEJOIN_245] (rows=548860207 width=127)
                                           Conds:RS_47._col5=RS_272._col0(Left Outer),Output:["_col1","_col4","_col6","_col13","_col14","_col20","_col21"]
                                         <-Map 21 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_272]
@@ -173,7 +173,7 @@ Stage-0
                                         <-Reducer 6 [SIMPLE_EDGE]
                                           SHUFFLE [RS_47]
                                             PartitionCols:_col5
-                                            Merge Join Operator [MERGEJOIN_244] (rows=7936938353 width=127)
+                                            Merge Join Operator [MERGEJOIN_244] (rows=548860207 width=127)
                                               Conds:RS_44._col17=RS_270._col0(Inner),Output:["_col1","_col4","_col5","_col6","_col13","_col14","_col20"]
                                             <-Map 20 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_270]
@@ -185,9 +185,9 @@ Stage-0
                                             <-Reducer 5 [SIMPLE_EDGE]
                                               SHUFFLE [RS_44]
                                                 PartitionCols:_col17
-                                                Filter Operator [FIL_43] (rows=7936938353 width=39)
+                                                Filter Operator [FIL_43] (rows=548860207 width=39)
                                                   predicate:(_col18 < _col7)
-                                                  Merge Join Operator [MERGEJOIN_243] (rows=23810815059 width=39)
+                                                  Merge Join Operator [MERGEJOIN_243] (rows=1646580622 width=39)
                                                     Conds:RS_40._col10, _col4=RS_268._col0, _col1(Inner),Output:["_col1","_col4","_col5","_col6","_col7","_col13","_col14","_col17","_col18"]
                                                   <-Map 19 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_268]
@@ -201,7 +201,7 @@ Stage-0
                                                   <-Reducer 4 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_40]
                                                       PartitionCols:_col10, _col4
-                                                      Merge Join Operator [MERGEJOIN_242] (rows=41723124 width=35)
+                                                      Merge Join Operator [MERGEJOIN_242] (rows=2885264 width=30)
                                                         Conds:RS_37._col0=RS_38._col2(Inner),Output:["_col1","_col4","_col5","_col6","_col7","_col10","_col13","_col14"]
                                                       <-Reducer 16 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_38]
@@ -229,7 +229,7 @@ Stage-0
                                                       <-Reducer 3 [SIMPLE_EDGE]
                                                         SHUFFLE [RS_37]
                                                           PartitionCols:_col0
-                                                          Merge Join Operator [MERGEJOIN_240] (rows=41723124 width=23)
+                                                          Merge Join Operator [MERGEJOIN_240] (rows=8138146 width=21)
                                                             Conds:RS_34._col3=RS_265._col0(Inner),Output:["_col0","_col1","_col4","_col5","_col6","_col7"]
                                                           <-Map 14 [SIMPLE_EDGE] vectorized
                                                             SHUFFLE [RS_265]
@@ -243,7 +243,7 @@ Stage-0
                                                           <-Reducer 2 [SIMPLE_EDGE]
                                                             SHUFFLE [RS_34]
                                                               PartitionCols:_col3
-                                                              Merge Join Operator [MERGEJOIN_239] (rows=41723124 width=27)
+                                                              Merge Join Operator [MERGEJOIN_239] (rows=40690727 width=27)
                                                                 Conds:RS_259._col2=RS_262._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7"]
                                                               <-Map 1 [SIMPLE_EDGE] vectorized
                                                                 SHUFFLE [RS_259]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query73.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query73.q.out
index b00fce2..f4ba280 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query73.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query73.q.out
@@ -100,18 +100,18 @@ Stage-0
               <-Reducer 8 [SIMPLE_EDGE] vectorized
                 SHUFFLE [RS_122]
                   PartitionCols:_col1
-                  Filter Operator [FIL_121] (rows=5 width=16)
+                  Filter Operator [FIL_121] (rows=5 width=12)
                     predicate:_col2 BETWEEN 1L AND 5L
-                    Select Operator [SEL_120] (rows=479121995 width=15)
+                    Select Operator [SEL_120] (rows=1893036 width=12)
                       Output:["_col0","_col1","_col2"]
-                      Group By Operator [GBY_119] (rows=479121995 width=15)
+                      Group By Operator [GBY_119] (rows=1893036 width=12)
                         Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
                       <-Reducer 7 [SIMPLE_EDGE]
                         SHUFFLE [RS_25]
                           PartitionCols:_col0, _col1
-                          Group By Operator [GBY_24] (rows=479121995 width=15)
+                          Group By Operator [GBY_24] (rows=1893036 width=12)
                             Output:["_col0","_col1","_col2"],aggregations:["count()"],keys:_col1, _col4
-                            Merge Join Operator [MERGEJOIN_98] (rows=479121995 width=7)
+                            Merge Join Operator [MERGEJOIN_98] (rows=1893036 width=4)
                               Conds:RS_20._col3=RS_118._col0(Inner),Output:["_col1","_col4"]
                             <-Map 12 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_118]
@@ -125,7 +125,7 @@ Stage-0
                             <-Reducer 6 [SIMPLE_EDGE]
                               SHUFFLE [RS_20]
                                 PartitionCols:_col3
-                                Merge Join Operator [MERGEJOIN_97] (rows=479121995 width=11)
+                                Merge Join Operator [MERGEJOIN_97] (rows=7136878 width=4)
                                   Conds:RS_17._col2=RS_115._col0(Inner),Output:["_col1","_col3","_col4"]
                                 <-Map 11 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_115]
@@ -139,7 +139,7 @@ Stage-0
                                 <-Reducer 5 [SIMPLE_EDGE]
                                   SHUFFLE [RS_17]
                                     PartitionCols:_col2
-                                    Merge Join Operator [MERGEJOIN_96] (rows=479121995 width=15)
+                                    Merge Join Operator [MERGEJOIN_96] (rows=44605486 width=10)
                                       Conds:RS_112._col0=RS_104._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                     <-Map 9 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_104]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query74.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query74.q.out
index 62b03db..31d1fee 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query74.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query74.q.out
@@ -164,17 +164,17 @@ Stage-0
       File Output Operator [FS_349]
         Limit [LIM_348] (rows=100 width=280)
           Number of rows:100
-          Select Operator [SEL_347] (rows=19066162 width=280)
+          Select Operator [SEL_347] (rows=12248094 width=280)
             Output:["_col0","_col1","_col2"]
           <-Reducer 7 [SIMPLE_EDGE]
             SHUFFLE [RS_89]
-              Select Operator [SEL_88] (rows=19066162 width=280)
+              Select Operator [SEL_88] (rows=12248094 width=280)
                 Output:["_col0","_col1","_col2"]
-                Top N Key Operator [TNK_154] (rows=19066162 width=732)
+                Top N Key Operator [TNK_154] (rows=12248094 width=732)
                   keys:_col8, _col7, _col9,top n:100
-                  Filter Operator [FIL_87] (rows=19066162 width=732)
+                  Filter Operator [FIL_87] (rows=12248094 width=732)
                     predicate:CASE WHEN (_col4 is not null) THEN (CASE WHEN (_col2) THEN (((_col6 / _col1) > (_col10 / _col4))) ELSE (false) END) ELSE (false) END
-                    Merge Join Operator [MERGEJOIN_284] (rows=38132324 width=732)
+                    Merge Join Operator [MERGEJOIN_284] (rows=24496188 width=732)
                       Conds:RS_84._col3=RS_346._col0(Inner),Output:["_col1","_col2","_col4","_col6","_col7","_col8","_col9","_col10"]
                     <-Reducer 20 [SIMPLE_EDGE] vectorized
                       SHUFFLE [RS_346]
@@ -186,7 +186,7 @@ Stage-0
                             PartitionCols:_col0, _col1, _col2
                             Group By Operator [GBY_74] (rows=80000000 width=392)
                               Output:["_col0","_col1","_col2","_col3"],aggregations:["max(_col2)"],keys:_col5, _col6, _col7
-                              Merge Join Operator [MERGEJOIN_281] (rows=525327388 width=386)
+                              Merge Join Operator [MERGEJOIN_281] (rows=187573258 width=377)
                                 Conds:RS_70._col1=RS_313._col0(Inner),Output:["_col2","_col5","_col6","_col7"]
                               <-Map 26 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_313]
@@ -198,7 +198,7 @@ Stage-0
                               <-Reducer 18 [SIMPLE_EDGE]
                                 SHUFFLE [RS_70]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_280] (rows=525327388 width=110)
+                                  Merge Join Operator [MERGEJOIN_280] (rows=187573258 width=101)
                                     Conds:RS_344._col0=RS_291._col0(Inner),Output:["_col1","_col2"]
                                   <-Map 21 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_291]
@@ -232,21 +232,21 @@ Stage-0
                     <-Reducer 6 [SIMPLE_EDGE]
                       SHUFFLE [RS_84]
                         PartitionCols:_col3
-                        Merge Join Operator [MERGEJOIN_283] (rows=31888273 width=440)
+                        Merge Join Operator [MERGEJOIN_283] (rows=20485012 width=440)
                           Conds:RS_81._col3=RS_339._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6"]
                         <-Reducer 16 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_339]
                             PartitionCols:_col0
-                            Select Operator [SEL_338] (rows=80000000 width=212)
+                            Select Operator [SEL_338] (rows=51391963 width=212)
                               Output:["_col0","_col1"]
-                              Group By Operator [GBY_337] (rows=80000000 width=392)
+                              Group By Operator [GBY_337] (rows=51391963 width=392)
                                 Output:["_col0","_col1","_col2","_col3"],aggregations:["max(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                               <-Reducer 15 [SIMPLE_EDGE]
                                 SHUFFLE [RS_56]
                                   PartitionCols:_col0, _col1, _col2
-                                  Group By Operator [GBY_55] (rows=80000000 width=392)
+                                  Group By Operator [GBY_55] (rows=51391963 width=392)
                                     Output:["_col0","_col1","_col2","_col3"],aggregations:["max(_col2)"],keys:_col5, _col6, _col7
-                                    Merge Join Operator [MERGEJOIN_279] (rows=143930993 width=391)
+                                    Merge Join Operator [MERGEJOIN_279] (rows=51391963 width=391)
                                       Conds:RS_51._col1=RS_314._col0(Inner),Output:["_col2","_col5","_col6","_col7"]
                                     <-Map 26 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_314]
@@ -255,7 +255,7 @@ Stage-0
                                     <-Reducer 14 [SIMPLE_EDGE]
                                       SHUFFLE [RS_51]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_278] (rows=143930993 width=115)
+                                        Merge Join Operator [MERGEJOIN_278] (rows=51391963 width=115)
                                           Conds:RS_336._col0=RS_293._col0(Inner),Output:["_col1","_col2"]
                                         <-Map 21 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_293]
@@ -284,7 +284,7 @@ Stage-0
                         <-Reducer 5 [SIMPLE_EDGE]
                           SHUFFLE [RS_81]
                             PartitionCols:_col3
-                            Merge Join Operator [MERGEJOIN_282] (rows=26666666 width=328)
+                            Merge Join Operator [MERGEJOIN_282] (rows=17130654 width=328)
                               Conds:RS_321._col0=RS_331._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                             <-Reducer 12 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_331]
@@ -302,7 +302,7 @@ Stage-0
                                           PartitionCols:_col0, _col1, _col2
                                           Group By Operator [GBY_35] (rows=80000000 width=392)
                                             Output:["_col0","_col1","_col2","_col3"],aggregations:["max(_col2)"],keys:_col5, _col6, _col7
-                                            Merge Join Operator [MERGEJOIN_277] (rows=525327388 width=386)
+                                            Merge Join Operator [MERGEJOIN_277] (rows=187573258 width=377)
                                               Conds:RS_31._col1=RS_316._col0(Inner),Output:["_col2","_col5","_col6","_col7"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_316]
@@ -311,7 +311,7 @@ Stage-0
                                             <-Reducer 10 [SIMPLE_EDGE]
                                               SHUFFLE [RS_31]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_276] (rows=525327388 width=110)
+                                                Merge Join Operator [MERGEJOIN_276] (rows=187573258 width=101)
                                                   Conds:RS_326._col0=RS_297._col0(Inner),Output:["_col1","_col2"]
                                                 <-Map 21 [SIMPLE_EDGE] vectorized
                                                   PARTITION_ONLY_SHUFFLE [RS_297]
@@ -344,20 +344,20 @@ Stage-0
                             <-Reducer 4 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_321]
                                 PartitionCols:_col0
-                                Select Operator [SEL_320] (rows=26666666 width=216)
+                                Select Operator [SEL_320] (rows=17130654 width=216)
                                   Output:["_col0","_col1","_col2"]
-                                  Filter Operator [FIL_319] (rows=26666666 width=212)
+                                  Filter Operator [FIL_319] (rows=17130654 width=212)
                                     predicate:(_col3 > 0)
-                                    Select Operator [SEL_318] (rows=80000000 width=212)
+                                    Select Operator [SEL_318] (rows=51391963 width=212)
                                       Output:["_col0","_col3"]
-                                      Group By Operator [GBY_317] (rows=80000000 width=392)
+                                      Group By Operator [GBY_317] (rows=51391963 width=392)
                                         Output:["_col0","_col1","_col2","_col3"],aggregations:["max(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2
                                       <-Reducer 3 [SIMPLE_EDGE]
                                         SHUFFLE [RS_16]
                                           PartitionCols:_col0, _col1, _col2
-                                          Group By Operator [GBY_15] (rows=80000000 width=392)
+                                          Group By Operator [GBY_15] (rows=51391963 width=392)
                                             Output:["_col0","_col1","_col2","_col3"],aggregations:["max(_col2)"],keys:_col5, _col6, _col7
-                                            Merge Join Operator [MERGEJOIN_275] (rows=143930993 width=391)
+                                            Merge Join Operator [MERGEJOIN_275] (rows=51391963 width=391)
                                               Conds:RS_11._col1=RS_315._col0(Inner),Output:["_col2","_col5","_col6","_col7"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_315]
@@ -366,7 +366,7 @@ Stage-0
                                             <-Reducer 2 [SIMPLE_EDGE]
                                               SHUFFLE [RS_11]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_274] (rows=143930993 width=115)
+                                                Merge Join Operator [MERGEJOIN_274] (rows=51391963 width=115)
                                                   Conds:RS_311._col0=RS_295._col0(Inner),Output:["_col1","_col2"]
                                                 <-Map 21 [SIMPLE_EDGE] vectorized
                                                   PARTITION_ONLY_SHUFFLE [RS_295]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query75.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query75.q.out
index 63d2612..a705dd8 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query75.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query75.q.out
@@ -204,42 +204,42 @@ Stage-0
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           Limit [LIM_610] (rows=100 width=152)
             Number of rows:100
-            Select Operator [SEL_609] (rows=7853634 width=152)
+            Select Operator [SEL_609] (rows=3422897230256 width=151)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
             <-Reducer 9 [SIMPLE_EDGE]
               SHUFFLE [RS_169]
-                Select Operator [SEL_168] (rows=7853634 width=152)
+                Select Operator [SEL_168] (rows=3422897230256 width=151)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                  Top N Key Operator [TNK_258] (rows=7853634 width=256)
+                  Top N Key Operator [TNK_258] (rows=3422897230256 width=255)
                     keys:(_col10 - _col4),top n:100
-                    Filter Operator [FIL_167] (rows=7853634 width=256)
+                    Filter Operator [FIL_167] (rows=3422897230256 width=255)
                       predicate:((CAST( _col10 AS decimal(17,2)) / CAST( _col4 AS decimal(17,2))) < 0.9)
-                      Merge Join Operator [MERGEJOIN_513] (rows=23560904 width=256)
+                      Merge Join Operator [MERGEJOIN_513] (rows=10268691690770 width=255)
                         Conds:RS_605._col0, _col1, _col2, _col3=RS_608._col0, _col1, _col2, _col3(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col10","_col11"]
                       <-Reducer 27 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_608]
                           PartitionCols:_col0, _col1, _col2, _col3
-                          Group By Operator [GBY_607] (rows=40320 width=136)
+                          Group By Operator [GBY_607] (rows=84235776 width=135)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                            Group By Operator [GBY_606] (rows=1541596122 width=131)
+                            Group By Operator [GBY_606] (rows=736356923 width=131)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
                             <-Union 26 [SIMPLE_EDGE]
                               <-Reducer 25 [CONTAINS] vectorized
                                 Reduce Output Operator [RS_636]
                                   PartitionCols:_col0, _col1, _col2, _col3
-                                  Group By Operator [GBY_635] (rows=1541596122 width=131)
+                                  Group By Operator [GBY_635] (rows=736356923 width=131)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                    Group By Operator [GBY_634] (rows=1298641485 width=131)
+                                    Group By Operator [GBY_634] (rows=621178955 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
                                     <-Union 24 [SIMPLE_EDGE]
                                       <-Reducer 23 [CONTAINS]
                                         Reduce Output Operator [RS_537]
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                          Group By Operator [GBY_536] (rows=1298641485 width=131)
+                                          Group By Operator [GBY_536] (rows=621178955 width=131)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                            Select Operator [SEL_534] (rows=455263131 width=131)
+                                            Select Operator [SEL_534] (rows=170474971 width=131)
                                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                              Merge Join Operator [MERGEJOIN_533] (rows=455263131 width=177)
+                                              Merge Join Operator [MERGEJOIN_533] (rows=170474971 width=234)
                                                 Conds:RS_99._col1, _col2=RS_599._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                               <-Map 38 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_599]
@@ -251,7 +251,7 @@ Stage-0
                                               <-Reducer 22 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_99]
                                                   PartitionCols:_col1, _col2
-                                                  Merge Join Operator [MERGEJOIN_505] (rows=273092954 width=139)
+                                                  Merge Join Operator [MERGEJOIN_505] (rows=96821196 width=138)
                                                     Conds:RS_96._col1=RS_594._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                                   <-Map 37 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_594]
@@ -265,7 +265,7 @@ Stage-0
                                                   <-Reducer 21 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_96]
                                                       PartitionCols:_col1
-                                                      Merge Join Operator [MERGEJOIN_504] (rows=286549727 width=123)
+                                                      Merge Join Operator [MERGEJOIN_504] (rows=101592102 width=122)
                                                         Conds:RS_633._col0=RS_566._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                       <-Map 11 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_566]
@@ -299,11 +299,11 @@ Stage-0
                                       <-Reducer 31 [CONTAINS]
                                         Reduce Output Operator [RS_546]
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                          Group By Operator [GBY_545] (rows=1298641485 width=131)
+                                          Group By Operator [GBY_545] (rows=621178955 width=131)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                            Select Operator [SEL_543] (rows=843378354 width=131)
+                                            Select Operator [SEL_543] (rows=450703984 width=131)
                                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                              Merge Join Operator [MERGEJOIN_542] (rows=843378354 width=205)
+                                              Merge Join Operator [MERGEJOIN_542] (rows=450703984 width=204)
                                                 Conds:RS_120._col1, _col2=RS_620._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                               <-Map 40 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_620]
@@ -315,7 +315,7 @@ Stage-0
                                               <-Reducer 30 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_120]
                                                   PartitionCols:_col1, _col2
-                                                  Merge Join Operator [MERGEJOIN_508] (rows=524244194 width=134)
+                                                  Merge Join Operator [MERGEJOIN_508] (rows=187186493 width=124)
                                                     Conds:RS_117._col1=RS_595._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                                   <-Map 37 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_595]
@@ -324,7 +324,7 @@ Stage-0
                                                   <-Reducer 29 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_117]
                                                       PartitionCols:_col1
-                                                      Merge Join Operator [MERGEJOIN_507] (rows=550076554 width=118)
+                                                      Merge Join Operator [MERGEJOIN_507] (rows=196410188 width=109)
                                                         Conds:RS_641._col0=RS_568._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                       <-Map 11 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_568]
@@ -357,11 +357,11 @@ Stage-0
                               <-Reducer 35 [CONTAINS]
                                 Reduce Output Operator [RS_551]
                                   PartitionCols:_col0, _col1, _col2, _col3
-                                  Group By Operator [GBY_550] (rows=1541596122 width=131)
+                                  Group By Operator [GBY_550] (rows=736356923 width=131)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                    Select Operator [SEL_548] (rows=242954637 width=131)
+                                    Select Operator [SEL_548] (rows=115177968 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                      Merge Join Operator [MERGEJOIN_547] (rows=242954637 width=199)
+                                      Merge Join Operator [MERGEJOIN_547] (rows=115177968 width=220)
                                         Conds:RS_148._col1, _col2=RS_628._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                       <-Map 42 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_628]
@@ -373,7 +373,7 @@ Stage-0
                                       <-Reducer 34 [SIMPLE_EDGE]
                                         SHUFFLE [RS_148]
                                           PartitionCols:_col1, _col2
-                                          Merge Join Operator [MERGEJOIN_511] (rows=137205980 width=139)
+                                          Merge Join Operator [MERGEJOIN_511] (rows=48990732 width=139)
                                             Conds:RS_145._col1=RS_596._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                           <-Map 37 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_596]
@@ -382,7 +382,7 @@ Stage-0
                                           <-Reducer 33 [SIMPLE_EDGE]
                                             SHUFFLE [RS_145]
                                               PartitionCols:_col1
-                                              Merge Join Operator [MERGEJOIN_510] (rows=143966864 width=123)
+                                              Merge Join Operator [MERGEJOIN_510] (rows=51404771 width=123)
                                                 Conds:RS_646._col0=RS_570._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                               <-Map 11 [SIMPLE_EDGE] vectorized
                                                 PARTITION_ONLY_SHUFFLE [RS_570]
@@ -415,19 +415,19 @@ Stage-0
                       <-Reducer 8 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_605]
                           PartitionCols:_col0, _col1, _col2, _col3
-                          Group By Operator [GBY_604] (rows=40320 width=136)
+                          Group By Operator [GBY_604] (rows=84235776 width=135)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                            Group By Operator [GBY_603] (rows=1541596122 width=131)
+                            Group By Operator [GBY_603] (rows=736356923 width=131)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
                             <-Union 7 [SIMPLE_EDGE]
                               <-Reducer 19 [CONTAINS]
                                 Reduce Output Operator [RS_532]
                                   PartitionCols:_col0, _col1, _col2, _col3
-                                  Group By Operator [GBY_531] (rows=1541596122 width=131)
+                                  Group By Operator [GBY_531] (rows=736356923 width=131)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                    Select Operator [SEL_529] (rows=242954637 width=131)
+                                    Select Operator [SEL_529] (rows=115177968 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                      Merge Join Operator [MERGEJOIN_528] (rows=242954637 width=199)
+                                      Merge Join Operator [MERGEJOIN_528] (rows=115177968 width=220)
                                         Conds:RS_66._col1, _col2=RS_627._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                       <-Map 42 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_627]
@@ -436,7 +436,7 @@ Stage-0
                                       <-Reducer 18 [SIMPLE_EDGE]
                                         SHUFFLE [RS_66]
                                           PartitionCols:_col1, _col2
-                                          Merge Join Operator [MERGEJOIN_502] (rows=137205980 width=139)
+                                          Merge Join Operator [MERGEJOIN_502] (rows=48990732 width=139)
                                             Conds:RS_63._col1=RS_593._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                           <-Map 37 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_593]
@@ -445,7 +445,7 @@ Stage-0
                                           <-Reducer 17 [SIMPLE_EDGE]
                                             SHUFFLE [RS_63]
                                               PartitionCols:_col1
-                                              Merge Join Operator [MERGEJOIN_501] (rows=143966864 width=123)
+                                              Merge Join Operator [MERGEJOIN_501] (rows=51404771 width=123)
                                                 Conds:RS_625._col0=RS_564._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                               <-Map 11 [SIMPLE_EDGE] vectorized
                                                 PARTITION_ONLY_SHUFFLE [RS_564]
@@ -478,19 +478,19 @@ Stage-0
                               <-Reducer 6 [CONTAINS] vectorized
                                 Reduce Output Operator [RS_602]
                                   PartitionCols:_col0, _col1, _col2, _col3
-                                  Group By Operator [GBY_601] (rows=1541596122 width=131)
+                                  Group By Operator [GBY_601] (rows=736356923 width=131)
                                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                    Group By Operator [GBY_600] (rows=1298641485 width=131)
+                                    Group By Operator [GBY_600] (rows=621178955 width=131)
                                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
                                     <-Union 5 [SIMPLE_EDGE]
                                       <-Reducer 15 [CONTAINS]
                                         Reduce Output Operator [RS_527]
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                          Group By Operator [GBY_526] (rows=1298641485 width=131)
+                                          Group By Operator [GBY_526] (rows=621178955 width=131)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                            Select Operator [SEL_524] (rows=843378354 width=131)
+                                            Select Operator [SEL_524] (rows=450703984 width=131)
                                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                              Merge Join Operator [MERGEJOIN_523] (rows=843378354 width=205)
+                                              Merge Join Operator [MERGEJOIN_523] (rows=450703984 width=204)
                                                 Conds:RS_38._col1, _col2=RS_619._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                               <-Map 40 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_619]
@@ -499,7 +499,7 @@ Stage-0
                                               <-Reducer 14 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_38]
                                                   PartitionCols:_col1, _col2
-                                                  Merge Join Operator [MERGEJOIN_499] (rows=524244194 width=134)
+                                                  Merge Join Operator [MERGEJOIN_499] (rows=187186493 width=124)
                                                     Conds:RS_35._col1=RS_592._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                                   <-Map 37 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_592]
@@ -508,7 +508,7 @@ Stage-0
                                                   <-Reducer 13 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_35]
                                                       PartitionCols:_col1
-                                                      Merge Join Operator [MERGEJOIN_498] (rows=550076554 width=118)
+                                                      Merge Join Operator [MERGEJOIN_498] (rows=196410188 width=109)
                                                         Conds:RS_617._col0=RS_562._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                       <-Map 11 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_562]
@@ -537,11 +537,11 @@ Stage-0
                                       <-Reducer 4 [CONTAINS]
                                         Reduce Output Operator [RS_518]
                                           PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
-                                          Group By Operator [GBY_517] (rows=1298641485 width=131)
+                                          Group By Operator [GBY_517] (rows=621178955 width=131)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
-                                            Select Operator [SEL_515] (rows=455263131 width=131)
+                                            Select Operator [SEL_515] (rows=170474971 width=131)
                                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                              Merge Join Operator [MERGEJOIN_514] (rows=455263131 width=177)
+                                              Merge Join Operator [MERGEJOIN_514] (rows=170474971 width=234)
                                                 Conds:RS_17._col1, _col2=RS_598._col0, _col1(Left Outer),Output:["_col3","_col4","_col7","_col8","_col9","_col10","_col13","_col14"]
                                               <-Map 38 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_598]
@@ -550,7 +550,7 @@ Stage-0
                                               <-Reducer 3 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_17]
                                                   PartitionCols:_col1, _col2
-                                                  Merge Join Operator [MERGEJOIN_496] (rows=273092954 width=139)
+                                                  Merge Join Operator [MERGEJOIN_496] (rows=96821196 width=138)
                                                     Conds:RS_14._col1=RS_591._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col7","_col8","_col9","_col10"]
                                                   <-Map 37 [SIMPLE_EDGE] vectorized
                                                     SHUFFLE [RS_591]
@@ -559,7 +559,7 @@ Stage-0
                                                   <-Reducer 2 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_14]
                                                       PartitionCols:_col1
-                                                      Merge Join Operator [MERGEJOIN_495] (rows=286549727 width=123)
+                                                      Merge Join Operator [MERGEJOIN_495] (rows=101592102 width=122)
                                                         Conds:RS_588._col0=RS_560._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
                                                       <-Map 11 [SIMPLE_EDGE] vectorized
                                                         PARTITION_ONLY_SHUFFLE [RS_560]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query77.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query77.q.out
index e8cfe33..603dc44 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query77.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query77.q.out
@@ -264,38 +264,38 @@ Stage-0
     Stage-1
       Reducer 7 vectorized
       File Output Operator [FS_276]
-        Limit [LIM_275] (rows=100 width=438)
+        Limit [LIM_275] (rows=58 width=437)
           Number of rows:100
-          Select Operator [SEL_274] (rows=564 width=438)
+          Select Operator [SEL_274] (rows=58 width=437)
             Output:["_col0","_col1","_col2","_col3","_col4"]
           <-Reducer 6 [SIMPLE_EDGE] vectorized
             SHUFFLE [RS_273]
-              Select Operator [SEL_272] (rows=564 width=438)
+              Select Operator [SEL_272] (rows=58 width=437)
                 Output:["_col0","_col1","_col2","_col3","_col4"]
-                Group By Operator [GBY_271] (rows=564 width=446)
+                Group By Operator [GBY_271] (rows=58 width=445)
                   Output:["_col0","_col1","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
                 <-Union 5 [SIMPLE_EDGE]
                   <-Reducer 14 [CONTAINS]
                     Reduce Output Operator [RS_235]
                       PartitionCols:_col0, _col1, _col2
-                      Group By Operator [GBY_234] (rows=564 width=446)
+                      Group By Operator [GBY_234] (rows=58 width=445)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L
-                        Top N Key Operator [TNK_233] (rows=531 width=435)
+                        Top N Key Operator [TNK_233] (rows=39 width=435)
                           keys:_col0, _col1,top n:100
-                          Select Operator [SEL_231] (rows=10 width=439)
+                          Select Operator [SEL_231] (rows=2 width=439)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Merge Join Operator [MERGEJOIN_230] (rows=10 width=452)
+                            Merge Join Operator [MERGEJOIN_230] (rows=2 width=452)
                               Conds:(Inner),Output:["_col0","_col1","_col2","_col3","_col4"]
                             <-Reducer 13 [CUSTOM_SIMPLE_EDGE] vectorized
                               PARTITION_ONLY_SHUFFLE [RS_283]
-                                Group By Operator [GBY_282] (rows=10 width=228)
+                                Group By Operator [GBY_282] (rows=2 width=228)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                                 <-Reducer 12 [SIMPLE_EDGE]
                                   SHUFFLE [RS_45]
                                     PartitionCols:_col0
-                                    Group By Operator [GBY_44] (rows=2550 width=227)
+                                    Group By Operator [GBY_44] (rows=56 width=227)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col2)","sum(_col3)"],keys:_col1
-                                      Merge Join Operator [MERGEJOIN_217] (rows=286549727 width=227)
+                                      Merge Join Operator [MERGEJOIN_217] (rows=31836679 width=222)
                                         Conds:RS_281._col0=RS_247._col0(Inner),Output:["_col1","_col2","_col3"]
                                       <-Map 8 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_247]
@@ -352,27 +352,27 @@ Stage-0
                   <-Reducer 20 [CONTAINS]
                     Reduce Output Operator [RS_241]
                       PartitionCols:_col0, _col1, _col2
-                      Group By Operator [GBY_240] (rows=564 width=446)
+                      Group By Operator [GBY_240] (rows=58 width=445)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L
-                        Top N Key Operator [TNK_239] (rows=531 width=435)
+                        Top N Key Operator [TNK_239] (rows=39 width=435)
                           keys:_col0, _col1,top n:100
-                          Select Operator [SEL_237] (rows=394 width=435)
+                          Select Operator [SEL_237] (rows=25 width=435)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Merge Join Operator [MERGEJOIN_236] (rows=394 width=335)
+                            Merge Join Operator [MERGEJOIN_236] (rows=25 width=452)
                               Conds:RS_295._col0=RS_300._col0(Left Outer),Output:["_col0","_col1","_col2","_col4","_col5"]
                             <-Reducer 19 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_295]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_294] (rows=206 width=228)
+                                Group By Operator [GBY_294] (rows=24 width=228)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                                 <-Reducer 18 [SIMPLE_EDGE]
                                   SHUFFLE [RS_79]
                                     PartitionCols:_col0
-                                    Group By Operator [GBY_78] (rows=26574 width=227)
+                                    Group By Operator [GBY_78] (rows=360 width=228)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col1)","sum(_col2)"],keys:_col0
-                                      Select Operator [SEL_76] (rows=143931136 width=227)
+                                      Select Operator [SEL_76] (rows=15991254 width=227)
                                         Output:["_col0","_col1","_col2"]
-                                        Merge Join Operator [MERGEJOIN_219] (rows=143931136 width=227)
+                                        Merge Join Operator [MERGEJOIN_219] (rows=15991254 width=227)
                                           Conds:RS_293._col0=RS_250._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 8 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_250]
@@ -401,16 +401,16 @@ Stage-0
                             <-Reducer 23 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_300]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_299] (rows=188 width=227)
+                                Group By Operator [GBY_299] (rows=24 width=226)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                                 <-Reducer 22 [SIMPLE_EDGE]
                                   SHUFFLE [RS_94]
                                     PartitionCols:_col0
-                                    Group By Operator [GBY_93] (rows=2256 width=227)
+                                    Group By Operator [GBY_93] (rows=24 width=226)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col1)","sum(_col2)"],keys:_col0
-                                      Select Operator [SEL_91] (rows=13129719 width=217)
+                                      Select Operator [SEL_91] (rows=1458758 width=135)
                                         Output:["_col0","_col1","_col2"]
-                                        Merge Join Operator [MERGEJOIN_220] (rows=13129719 width=217)
+                                        Merge Join Operator [MERGEJOIN_220] (rows=1458758 width=135)
                                           Conds:RS_298._col0=RS_252._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 8 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_252]
@@ -428,27 +428,27 @@ Stage-0
                   <-Reducer 4 [CONTAINS]
                     Reduce Output Operator [RS_229]
                       PartitionCols:_col0, _col1, _col2
-                      Group By Operator [GBY_228] (rows=564 width=446)
+                      Group By Operator [GBY_228] (rows=58 width=445)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col2)","sum(_col3)","sum(_col4)"],keys:_col0, _col1, 0L
-                        Top N Key Operator [TNK_227] (rows=531 width=435)
+                        Top N Key Operator [TNK_227] (rows=39 width=435)
                           keys:_col0, _col1,top n:100
-                          Select Operator [SEL_225] (rows=127 width=436)
+                          Select Operator [SEL_225] (rows=12 width=436)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Merge Join Operator [MERGEJOIN_224] (rows=127 width=379)
+                            Merge Join Operator [MERGEJOIN_224] (rows=12 width=451)
                               Conds:RS_265._col0=RS_270._col0(Left Outer),Output:["_col0","_col1","_col2","_col4","_col5"]
                             <-Reducer 11 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_270]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_269] (rows=85 width=227)
+                                Group By Operator [GBY_269] (rows=11 width=226)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                                 <-Reducer 10 [SIMPLE_EDGE]
                                   SHUFFLE [RS_27]
                                     PartitionCols:_col0
-                                    Group By Operator [GBY_26] (rows=3995 width=227)
+                                    Group By Operator [GBY_26] (rows=44 width=226)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col1)","sum(_col2)"],keys:_col0
-                                      Select Operator [SEL_24] (rows=53634860 width=220)
+                                      Select Operator [SEL_24] (rows=5959021 width=156)
                                         Output:["_col0","_col1","_col2"]
-                                        Merge Join Operator [MERGEJOIN_216] (rows=53634860 width=220)
+                                        Merge Join Operator [MERGEJOIN_216] (rows=5959021 width=156)
                                           Conds:RS_268._col0=RS_246._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 8 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_246]
@@ -466,16 +466,16 @@ Stage-0
                             <-Reducer 3 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_265]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_264] (rows=84 width=227)
+                                Group By Operator [GBY_264] (rows=11 width=226)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_12]
                                     PartitionCols:_col0
-                                    Group By Operator [GBY_11] (rows=37548 width=227)
+                                    Group By Operator [GBY_11] (rows=341 width=226)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(_col1)","sum(_col2)"],keys:_col0
-                                      Select Operator [SEL_9] (rows=525329897 width=217)
+                                      Select Operator [SEL_9] (rows=58365993 width=135)
                                         Output:["_col0","_col1","_col2"]
-                                        Merge Join Operator [MERGEJOIN_215] (rows=525329897 width=217)
+                                        Merge Join Operator [MERGEJOIN_215] (rows=58365993 width=135)
                                           Conds:RS_263._col0=RS_244._col0(Inner),Output:["_col1","_col2","_col3"]
                                         <-Map 8 [SIMPLE_EDGE] vectorized
                                           PARTITION_ONLY_SHUFFLE [RS_244]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query78.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query78.q.out
index dd4aaed..21819bc 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query78.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query78.q.out
@@ -158,29 +158,29 @@ Stage-0
       File Output Operator [FS_270]
         Limit [LIM_269] (rows=100 width=484)
           Number of rows:100
-          Select Operator [SEL_268] (rows=5221812635288 width=483)
+          Select Operator [SEL_268] (rows=1831943309558 width=483)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           <-Reducer 5 [SIMPLE_EDGE]
             SHUFFLE [RS_73]
-              Select Operator [SEL_72] (rows=5221812635288 width=719)
+              Select Operator [SEL_72] (rows=1831943309558 width=719)
                 Output:["_col0","_col1","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
-                Top N Key Operator [TNK_114] (rows=5221812635288 width=703)
+                Top N Key Operator [TNK_114] (rows=1831943309558 width=703)
                   keys:_col0, _col1, _col2, _col3, _col4, (CASE WHEN (_col11 is not null) THEN (_col11) ELSE (0L) END + CASE WHEN (_col6 is not null) THEN (_col6) ELSE (0L) END), (CASE WHEN (_col12 is not null) THEN (_col12) ELSE (0) END + CASE WHEN (_col7 is not null) THEN (_col7) ELSE (0) END), (CASE WHEN (_col13 is not null) THEN (_col13) ELSE (0) END + CASE WHEN (_col8 is not null) THEN (_col8) ELSE (0) END), round((UDFToDouble(_col2) / UDFToDouble(CASE WHEN ((_col11 is not null and  [...]
-                  Merge Join Operator [MERGEJOIN_221] (rows=5221812635288 width=703)
+                  Merge Join Operator [MERGEJOIN_221] (rows=1831943309558 width=703)
                     Conds:RS_69._col0, _col1=RS_267._col0, _col1(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col6","_col7","_col8","_col11","_col12","_col13"]
                   <-Reducer 12 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_267]
                       PartitionCols:_col0, _col1
-                      Filter Operator [FIL_266] (rows=113538342 width=239)
+                      Filter Operator [FIL_266] (rows=40539971 width=239)
                         predicate:(_col2 > 0L)
-                        Group By Operator [GBY_265] (rows=113538342 width=239)
+                        Group By Operator [GBY_265] (rows=40539971 width=239)
                           Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1
                         <-Reducer 11 [SIMPLE_EDGE]
                           SHUFFLE [RS_62]
                             PartitionCols:_col0, _col1
-                            Group By Operator [GBY_61] (rows=113538342 width=239)
+                            Group By Operator [GBY_61] (rows=40539971 width=239)
                               Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col4)","sum(_col5)","sum(_col6)"],keys:_col2, _col3
-                              Merge Join Operator [MERGEJOIN_219] (rows=113538342 width=235)
+                              Merge Join Operator [MERGEJOIN_219] (rows=40539971 width=235)
                                 Conds:RS_228._col0=RS_58._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
                               <-Map 1 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_228]
@@ -230,21 +230,21 @@ Stage-0
                   <-Reducer 4 [SIMPLE_EDGE]
                     SHUFFLE [RS_69]
                       PartitionCols:_col0, _col1
-                      Merge Join Operator [MERGEJOIN_220] (rows=65074513381 width=471)
+                      Merge Join Operator [MERGEJOIN_220] (rows=22841150061 width=471)
                         Conds:RS_245._col1=RS_257._col0(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col6","_col7","_col8"]
                       <-Reducer 3 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_245]
                           PartitionCols:_col1
-                          Select Operator [SEL_244] (rows=319876350 width=239)
+                          Select Operator [SEL_244] (rows=114214965 width=239)
                             Output:["_col0","_col1","_col2","_col3","_col4"]
-                            Group By Operator [GBY_243] (rows=319876350 width=239)
+                            Group By Operator [GBY_243] (rows=114214965 width=239)
                               Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1
                             <-Reducer 2 [SIMPLE_EDGE]
                               SHUFFLE [RS_18]
                                 PartitionCols:_col0, _col1
-                                Group By Operator [GBY_17] (rows=319876350 width=239)
+                                Group By Operator [GBY_17] (rows=114214965 width=239)
                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col4)","sum(_col5)","sum(_col6)"],keys:_col3, _col2
-                                  Merge Join Operator [MERGEJOIN_215] (rows=319876350 width=229)
+                                  Merge Join Operator [MERGEJOIN_215] (rows=114214965 width=218)
                                     Conds:RS_224._col0=RS_14._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
                                   <-Map 1 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_224]
@@ -289,20 +289,20 @@ Stage-0
                       <-Reducer 9 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_257]
                           PartitionCols:_col0
-                          Select Operator [SEL_256] (rows=285117831 width=235)
+                          Select Operator [SEL_256] (rows=101084444 width=235)
                             Output:["_col0","_col1","_col2","_col3"]
-                            Filter Operator [FIL_255] (rows=285117831 width=239)
+                            Filter Operator [FIL_255] (rows=101084444 width=239)
                               predicate:(_col2 > 0L)
-                              Select Operator [SEL_254] (rows=285117831 width=239)
+                              Select Operator [SEL_254] (rows=101084444 width=239)
                                 Output:["_col1","_col2","_col3","_col4"]
-                                Group By Operator [GBY_253] (rows=285117831 width=239)
+                                Group By Operator [GBY_253] (rows=101084444 width=239)
                                   Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"],keys:KEY._col0, KEY._col1
                                 <-Reducer 8 [SIMPLE_EDGE]
                                   SHUFFLE [RS_39]
                                     PartitionCols:_col0, _col1
-                                    Group By Operator [GBY_38] (rows=285117831 width=239)
+                                    Group By Operator [GBY_38] (rows=101084444 width=239)
                                       Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col4)","sum(_col5)","sum(_col6)"],keys:_col2, _col3
-                                      Merge Join Operator [MERGEJOIN_217] (rows=285117831 width=235)
+                                      Merge Join Operator [MERGEJOIN_217] (rows=101084444 width=233)
                                         Conds:RS_226._col0=RS_35._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6"]
                                       <-Map 1 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_226]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query79.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query79.q.out
index 2b94615..d875ec9 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query79.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query79.q.out
@@ -74,15 +74,15 @@ Stage-0
       File Output Operator [FS_125]
         Limit [LIM_124] (rows=100 width=592)
           Number of rows:100
-          Select Operator [SEL_123] (rows=479121995 width=592)
+          Select Operator [SEL_123] (rows=91407175 width=592)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 2 [SIMPLE_EDGE]
             SHUFFLE [RS_32]
-              Select Operator [SEL_31] (rows=479121995 width=592)
+              Select Operator [SEL_31] (rows=91407175 width=592)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                Top N Key Operator [TNK_56] (rows=479121995 width=593)
+                Top N Key Operator [TNK_56] (rows=91407175 width=593)
                   keys:_col2, _col1, substr(_col5, 1, 30), _col7,top n:100
-                  Merge Join Operator [MERGEJOIN_100] (rows=479121995 width=593)
+                  Merge Join Operator [MERGEJOIN_100] (rows=91407175 width=593)
                     Conds:RS_102._col0=RS_122._col1(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7","_col8"]
                   <-Map 1 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_102]
@@ -94,16 +94,16 @@ Stage-0
                   <-Reducer 8 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_122]
                       PartitionCols:_col1
-                      Select Operator [SEL_121] (rows=479121995 width=416)
+                      Select Operator [SEL_121] (rows=91407175 width=416)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                        Group By Operator [GBY_120] (rows=479121995 width=328)
+                        Group By Operator [GBY_120] (rows=91407175 width=327)
                           Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
                         <-Reducer 7 [SIMPLE_EDGE]
                           SHUFFLE [RS_25]
                             PartitionCols:_col0, _col1, _col2, _col3
-                            Group By Operator [GBY_24] (rows=479121995 width=328)
+                            Group By Operator [GBY_24] (rows=91407175 width=327)
                               Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col6)","sum(_col7)"],keys:_col1, _col3, _col5, _col10
-                              Merge Join Operator [MERGEJOIN_99] (rows=479121995 width=318)
+                              Merge Join Operator [MERGEJOIN_99] (rows=91407175 width=274)
                                 Conds:RS_20._col2=RS_119._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col7","_col10"]
                               <-Map 12 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_119]
@@ -117,7 +117,7 @@ Stage-0
                               <-Reducer 6 [SIMPLE_EDGE]
                                 SHUFFLE [RS_20]
                                   PartitionCols:_col2
-                                  Merge Join Operator [MERGEJOIN_98] (rows=479121995 width=322)
+                                  Merge Join Operator [MERGEJOIN_98] (rows=102592623 width=283)
                                     Conds:RS_17._col4=RS_116._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col7","_col10"]
                                   <-Map 11 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_116]
@@ -131,7 +131,7 @@ Stage-0
                                   <-Reducer 5 [SIMPLE_EDGE]
                                     SHUFFLE [RS_17]
                                       PartitionCols:_col4
-                                      Merge Join Operator [MERGEJOIN_97] (rows=479121995 width=233)
+                                      Merge Join Operator [MERGEJOIN_97] (rows=102592623 width=193)
                                         Conds:RS_113._col0=RS_105._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                                       <-Map 9 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_105]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query8.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query8.q.out
index 06b9f6f..91f3f5e 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query8.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query8.q.out
@@ -257,11 +257,11 @@ Stage-0
               <-Reducer 3 [SIMPLE_EDGE]
                 SHUFFLE [RS_57]
                   PartitionCols:_col0
-                  Group By Operator [GBY_56] (rows=401 width=200)
+                  Group By Operator [GBY_56] (rows=1 width=200)
                     Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col6
-                    Top N Key Operator [TNK_87] (rows=525329897 width=194)
+                    Top N Key Operator [TNK_87] (rows=1 width=200)
                       keys:_col6,top n:100
-                      Merge Join Operator [MERGEJOIN_123] (rows=525329897 width=194)
+                      Merge Join Operator [MERGEJOIN_123] (rows=1 width=200)
                         Conds:RS_52._col1=RS_53._col1(Inner),Output:["_col2","_col6"]
                       <-Reducer 12 [SIMPLE_EDGE]
                         SHUFFLE [RS_53]
@@ -351,7 +351,7 @@ Stage-0
                       <-Reducer 2 [SIMPLE_EDGE]
                         SHUFFLE [RS_52]
                           PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_120] (rows=525329897 width=110)
+                          Merge Join Operator [MERGEJOIN_120] (rows=37399754 width=42)
                             Conds:RS_142._col0=RS_134._col0(Inner),Output:["_col1","_col2"]
                           <-Map 6 [SIMPLE_EDGE] vectorized
                             PARTITION_ONLY_SHUFFLE [RS_134]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query80.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query80.q.out
index 9c82167..c90b253 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query80.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query80.q.out
@@ -275,11 +275,11 @@ Stage-0
                             <-Reducer 17 [SIMPLE_EDGE]
                               SHUFFLE [RS_71]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_70] (rows=7613816 width=436)
+                                Group By Operator [GBY_70] (rows=427306 width=436)
                                   Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)"],keys:_col0
-                                  Select Operator [SEL_68] (rows=154681759 width=322)
+                                  Select Operator [SEL_68] (rows=8592843 width=305)
                                     Output:["_col0","_col1","_col2","_col3"]
-                                    Merge Join Operator [MERGEJOIN_368] (rows=154681759 width=322)
+                                    Merge Join Operator [MERGEJOIN_368] (rows=8592843 width=305)
                                       Conds:RS_65._col1=RS_444._col0(Inner),Output:["_col5","_col6","_col9","_col10","_col15"]
                                     <-Map 32 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_444]
@@ -291,7 +291,7 @@ Stage-0
                                     <-Reducer 16 [SIMPLE_EDGE]
                                       SHUFFLE [RS_65]
                                         PartitionCols:_col1
-                                        Merge Join Operator [MERGEJOIN_367] (rows=154681759 width=226)
+                                        Merge Join Operator [MERGEJOIN_367] (rows=8592843 width=208)
                                           Conds:RS_62._col3=RS_421._col0(Inner),Output:["_col1","_col5","_col6","_col9","_col10"]
                                         <-Map 27 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_421]
@@ -305,7 +305,7 @@ Stage-0
                                         <-Reducer 15 [SIMPLE_EDGE]
                                           SHUFFLE [RS_62]
                                             PartitionCols:_col3
-                                            Merge Join Operator [MERGEJOIN_366] (rows=154681759 width=230)
+                                            Merge Join Operator [MERGEJOIN_366] (rows=17185686 width=222)
                                               Conds:RS_59._col2=RS_416._col0(Inner),Output:["_col1","_col3","_col5","_col6","_col9","_col10"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_416]
@@ -319,7 +319,7 @@ Stage-0
                                             <-Reducer 14 [SIMPLE_EDGE]
                                               SHUFFLE [RS_59]
                                                 PartitionCols:_col2
-                                                Merge Join Operator [MERGEJOIN_365] (rows=464045263 width=322)
+                                                Merge Join Operator [MERGEJOIN_365] (rows=51557056 width=232)
                                                   Conds:RS_56._col0=RS_396._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col9","_col10"]
                                                 <-Map 12 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_396]
@@ -376,11 +376,11 @@ Stage-0
                             <-Reducer 23 [SIMPLE_EDGE]
                               SHUFFLE [RS_109]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_108] (rows=5724 width=436)
+                                Group By Operator [GBY_108] (rows=318 width=436)
                                   Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)"],keys:_col0
-                                  Select Operator [SEL_106] (rows=84869669 width=323)
+                                  Select Operator [SEL_106] (rows=4714659 width=323)
                                     Output:["_col0","_col1","_col2","_col3"]
-                                    Merge Join Operator [MERGEJOIN_373] (rows=84869669 width=323)
+                                    Merge Join Operator [MERGEJOIN_373] (rows=4714659 width=323)
                                       Conds:RS_103._col2=RS_458._col0(Inner),Output:["_col5","_col6","_col9","_col10","_col15"]
                                     <-Map 36 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_458]
@@ -392,7 +392,7 @@ Stage-0
                                     <-Reducer 22 [SIMPLE_EDGE]
                                       SHUFFLE [RS_103]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_372] (rows=84869669 width=227)
+                                        Merge Join Operator [MERGEJOIN_372] (rows=4714659 width=227)
                                           Conds:RS_100._col3=RS_422._col0(Inner),Output:["_col2","_col5","_col6","_col9","_col10"]
                                         <-Map 27 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_422]
@@ -401,7 +401,7 @@ Stage-0
                                         <-Reducer 21 [SIMPLE_EDGE]
                                           SHUFFLE [RS_100]
                                             PartitionCols:_col3
-                                            Merge Join Operator [MERGEJOIN_371] (rows=84869669 width=231)
+                                            Merge Join Operator [MERGEJOIN_371] (rows=9429318 width=231)
                                               Conds:RS_97._col1=RS_417._col0(Inner),Output:["_col2","_col3","_col5","_col6","_col9","_col10"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_417]
@@ -410,7 +410,7 @@ Stage-0
                                             <-Reducer 20 [SIMPLE_EDGE]
                                               SHUFFLE [RS_97]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_370] (rows=254608997 width=359)
+                                                Merge Join Operator [MERGEJOIN_370] (rows=28287952 width=235)
                                                   Conds:RS_94._col0=RS_398._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col9","_col10"]
                                                 <-Map 12 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_398]
@@ -462,11 +462,11 @@ Stage-0
                             <-Reducer 6 [SIMPLE_EDGE]
                               SHUFFLE [RS_34]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_33] (rows=265506 width=436)
+                                Group By Operator [GBY_33] (rows=4932 width=436)
                                   Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col1)","sum(_col2)","sum(_col3)"],keys:_col0
-                                  Select Operator [SEL_31] (rows=270716624 width=305)
+                                  Select Operator [SEL_31] (rows=15038783 width=100)
                                     Output:["_col0","_col1","_col2","_col3"]
-                                    Merge Join Operator [MERGEJOIN_363] (rows=270716624 width=305)
+                                    Merge Join Operator [MERGEJOIN_363] (rows=15038783 width=100)
                                       Conds:RS_28._col2=RS_424._col0(Inner),Output:["_col5","_col6","_col9","_col10","_col15"]
                                     <-Map 28 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_424]
@@ -478,7 +478,7 @@ Stage-0
                                     <-Reducer 5 [SIMPLE_EDGE]
                                       SHUFFLE [RS_28]
                                         PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_362] (rows=270716624 width=208)
+                                        Merge Join Operator [MERGEJOIN_362] (rows=15038783 width=0)
                                           Conds:RS_25._col3=RS_420._col0(Inner),Output:["_col2","_col5","_col6","_col9","_col10"]
                                         <-Map 27 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_420]
@@ -487,7 +487,7 @@ Stage-0
                                         <-Reducer 4 [SIMPLE_EDGE]
                                           SHUFFLE [RS_25]
                                             PartitionCols:_col3
-                                            Merge Join Operator [MERGEJOIN_361] (rows=270716624 width=212)
+                                            Merge Join Operator [MERGEJOIN_361] (rows=30077566 width=57)
                                               Conds:RS_22._col1=RS_415._col0(Inner),Output:["_col2","_col3","_col5","_col6","_col9","_col10"]
                                             <-Map 26 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_415]
@@ -496,7 +496,7 @@ Stage-0
                                             <-Reducer 3 [SIMPLE_EDGE]
                                               SHUFFLE [RS_22]
                                                 PartitionCols:_col1
-                                                Merge Join Operator [MERGEJOIN_360] (rows=812149846 width=370)
+                                                Merge Join Operator [MERGEJOIN_360] (rows=90232695 width=177)
                                                   Conds:RS_19._col0=RS_394._col0(Inner),Output:["_col1","_col2","_col3","_col5","_col6","_col9","_col10"]
                                                 <-Map 12 [SIMPLE_EDGE] vectorized
                                                   SHUFFLE [RS_394]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query81.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query81.q.out
index 82e7c05..e07e6a2 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query81.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query81.q.out
@@ -92,24 +92,24 @@ Stage-0
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
           Limit [LIM_214] (rows=100 width=1417)
             Number of rows:100
-            Select Operator [SEL_213] (rows=1545467 width=1416)
+            Select Operator [SEL_213] (rows=1609248 width=1416)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
             <-Reducer 3 [SIMPLE_EDGE]
               SHUFFLE [RS_66]
-                Select Operator [SEL_65] (rows=1545467 width=1416)
+                Select Operator [SEL_65] (rows=1609248 width=1416)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
-                  Top N Key Operator [TNK_105] (rows=1545467 width=1418)
+                  Top N Key Operator [TNK_105] (rows=1609248 width=1418)
                     keys:_col1, _col3, _col4, _col5, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col19,top n:100
-                    Merge Join Operator [MERGEJOIN_182] (rows=1545467 width=1418)
+                    Merge Join Operator [MERGEJOIN_182] (rows=1609248 width=1418)
                       Conds:RS_62._col0=RS_63._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col19"]
                     <-Reducer 10 [SIMPLE_EDGE]
                       SHUFFLE [RS_63]
                         PartitionCols:_col0
-                        Select Operator [SEL_58] (rows=1545467 width=227)
+                        Select Operator [SEL_58] (rows=1609248 width=227)
                           Output:["_col0","_col2"]
-                          Filter Operator [FIL_57] (rows=1545467 width=227)
+                          Filter Operator [FIL_57] (rows=1609248 width=227)
                             predicate:(_col2 > _col3)
-                            Merge Join Operator [MERGEJOIN_181] (rows=4636401 width=227)
+                            Merge Join Operator [MERGEJOIN_181] (rows=4827746 width=227)
                               Conds:RS_206._col1=RS_212._col1(Inner),Output:["_col0","_col2","_col3"]
                             <-Reducer 13 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_212]
@@ -166,11 +166,11 @@ Stage-0
                             <-Reducer 9 [SIMPLE_EDGE] vectorized
                               SHUFFLE [RS_206]
                                 PartitionCols:_col1
-                                Filter Operator [FIL_205] (rows=4636401 width=201)
+                                Filter Operator [FIL_205] (rows=4827746 width=201)
                                   predicate:_col2 is not null
-                                  Select Operator [SEL_204] (rows=4636401 width=201)
+                                  Select Operator [SEL_204] (rows=4827746 width=201)
                                     Output:["_col0","_col1","_col2"]
-                                    Group By Operator [GBY_203] (rows=4636401 width=201)
+                                    Group By Operator [GBY_203] (rows=4827746 width=201)
                                       Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
                                     <-Reducer 8 [SIMPLE_EDGE]
                                       SHUFFLE [RS_23]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query83.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query83.q.out
index 44a7ea1..12f3378 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query83.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query83.q.out
@@ -169,29 +169,29 @@ Stage-0
       File Output Operator [FS_399]
         Limit [LIM_398] (rows=100 width=260)
           Number of rows:100
-          Select Operator [SEL_397] (rows=2739 width=260)
+          Select Operator [SEL_397] (rows=1260 width=260)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
           <-Reducer 7 [SIMPLE_EDGE]
             SHUFFLE [RS_121]
-              Select Operator [SEL_120] (rows=2739 width=260)
+              Select Operator [SEL_120] (rows=1260 width=260)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                Top N Key Operator [TNK_207] (rows=2739 width=132)
+                Top N Key Operator [TNK_207] (rows=1260 width=132)
                   keys:_col0, _col3,top n:100
-                  Merge Join Operator [MERGEJOIN_364] (rows=2739 width=132)
+                  Merge Join Operator [MERGEJOIN_364] (rows=1260 width=132)
                     Conds:RS_117._col0=RS_396._col0(Inner),Output:["_col0","_col1","_col3","_col5","_col6"]
                   <-Reducer 14 [SIMPLE_EDGE] vectorized
                     SHUFFLE [RS_396]
                       PartitionCols:_col0
-                      Select Operator [SEL_395] (rows=310774 width=116)
+                      Select Operator [SEL_395] (rows=1260 width=116)
                         Output:["_col0","_col1","_col2"]
-                        Group By Operator [GBY_394] (rows=310774 width=108)
+                        Group By Operator [GBY_394] (rows=1260 width=108)
                           Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                         <-Reducer 13 [SIMPLE_EDGE]
                           SHUFFLE [RS_111]
                             PartitionCols:_col0
-                            Group By Operator [GBY_110] (rows=1864644 width=108)
+                            Group By Operator [GBY_110] (rows=1260 width=108)
                               Output:["_col0","_col1"],aggregations:["sum(_col5)"],keys:_col7
-                              Merge Join Operator [MERGEJOIN_362] (rows=13749816 width=103)
+                              Merge Join Operator [MERGEJOIN_362] (rows=2521 width=100)
                                 Conds:RS_106._col4=RS_383._col0(Inner),Output:["_col5","_col7"]
                               <-Map 20 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_383]
@@ -203,7 +203,7 @@ Stage-0
                               <-Reducer 12 [SIMPLE_EDGE]
                                 SHUFFLE [RS_106]
                                   PartitionCols:_col4
-                                  Merge Join Operator [MERGEJOIN_361] (rows=13749816 width=7)
+                                  Merge Join Operator [MERGEJOIN_361] (rows=2521 width=4)
                                     Conds:RS_103._col0=RS_393._col0(Inner),Output:["_col4","_col5"]
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_103]
@@ -268,14 +268,14 @@ Stage-0
                       <-Reducer 11 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_390]
                           PartitionCols:_col0
-                          Group By Operator [GBY_389] (rows=310774 width=108)
+                          Group By Operator [GBY_389] (rows=5552 width=108)
                             Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
                           <-Reducer 10 [SIMPLE_EDGE]
                             SHUFFLE [RS_73]
                               PartitionCols:_col0
-                              Group By Operator [GBY_72] (rows=7147802 width=108)
+                              Group By Operator [GBY_72] (rows=5552 width=108)
                                 Output:["_col0","_col1"],aggregations:["sum(_col5)"],keys:_col7
-                                Merge Join Operator [MERGEJOIN_358] (rows=55578005 width=103)
+                                Merge Join Operator [MERGEJOIN_358] (rows=11105 width=100)
                                   Conds:RS_68._col4=RS_382._col0(Inner),Output:["_col5","_col7"]
                                 <-Map 20 [SIMPLE_EDGE] vectorized
                                   SHUFFLE [RS_382]
@@ -284,7 +284,7 @@ Stage-0
                                 <-Reducer 9 [SIMPLE_EDGE]
                                   SHUFFLE [RS_68]
                                     PartitionCols:_col4
-                                    Merge Join Operator [MERGEJOIN_357] (rows=55578005 width=7)
+                                    Merge Join Operator [MERGEJOIN_357] (rows=11105 width=4)
                                       Conds:RS_65._col0=RS_388._col0(Inner),Output:["_col4","_col5"]
                                     <-Reducer 2 [SIMPLE_EDGE]
                                       SHUFFLE [RS_65]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query84.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query84.q.out
index b520a2d..ee6a355 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query84.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query84.q.out
@@ -70,15 +70,15 @@ Stage-0
       File Output Operator [FS_140]
         Limit [LIM_139] (rows=100 width=384)
           Number of rows:100
-          Select Operator [SEL_138] (rows=2645278 width=384)
+          Select Operator [SEL_138] (rows=765839 width=384)
             Output:["_col0","_col1"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_35]
-              Select Operator [SEL_34] (rows=2645278 width=384)
+              Select Operator [SEL_34] (rows=765839 width=384)
                 Output:["_col1","_col2"]
-                Top N Key Operator [TNK_62] (rows=2645278 width=284)
+                Top N Key Operator [TNK_62] (rows=765839 width=284)
                   keys:_col2,top n:100
-                  Merge Join Operator [MERGEJOIN_120] (rows=2645278 width=284)
+                  Merge Join Operator [MERGEJOIN_120] (rows=765839 width=284)
                     Conds:RS_31._col4=RS_32._col0(Inner),Output:["_col2","_col6"]
                   <-Reducer 11 [SIMPLE_EDGE]
                     SHUFFLE [RS_32]
@@ -106,7 +106,7 @@ Stage-0
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_31]
                       PartitionCols:_col4
-                      Merge Join Operator [MERGEJOIN_119] (rows=2645278 width=287)
+                      Merge Join Operator [MERGEJOIN_119] (rows=2552796 width=287)
                         Conds:RS_28._col1=RS_29._col1(Inner),Output:["_col2","_col4","_col6"]
                       <-Reducer 2 [SIMPLE_EDGE]
                         SHUFFLE [RS_28]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query85.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query85.q.out
index 1d52378..199d8c8 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query85.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query85.q.out
@@ -215,9 +215,9 @@ Stage-0
                   <-Reducer 4 [SIMPLE_EDGE]
                     SHUFFLE [RS_43]
                       PartitionCols:_col0
-                      Group By Operator [GBY_42] (rows=576 width=353)
+                      Group By Operator [GBY_42] (rows=288 width=353)
                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)","count(_col3)","sum(_col27)","count(_col27)","sum(_col26)","count(_col26)"],keys:_col36
-                        Merge Join Operator [MERGEJOIN_178] (rows=5749608 width=319)
+                        Merge Join Operator [MERGEJOIN_178] (rows=2912400 width=313)
                           Conds:RS_38._col24=RS_202._col0(Inner),Output:["_col3","_col26","_col27","_col36"]
                         <-Map 15 [SIMPLE_EDGE] vectorized
                           SHUFFLE [RS_202]
@@ -229,16 +229,16 @@ Stage-0
                         <-Reducer 3 [SIMPLE_EDGE]
                           SHUFFLE [RS_38]
                             PartitionCols:_col24
-                            Filter Operator [FIL_36] (rows=5749608 width=285)
+                            Filter Operator [FIL_36] (rows=2912400 width=280)
                               predicate:(((_col29 and _col4) or (_col30 and _col5) or (_col31 and _col6)) and ((_col14 and _col15 and _col7) or (_col16 and _col17 and _col8) or (_col18 and _col19 and _col9)))
-                              Merge Join Operator [MERGEJOIN_177] (rows=20443061 width=285)
+                              Merge Join Operator [MERGEJOIN_177] (rows=10355208 width=280)
                                 Conds:RS_33._col1, _col2=RS_34._col9, _col14(Inner),Output:["_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col14","_col15","_col16","_col17","_col18","_col19","_col24","_col26","_col27","_col29","_col30","_col31"]
                               <-Reducer 12 [SIMPLE_EDGE]
                                 SHUFFLE [RS_34]
                                   PartitionCols:_col9, _col14
-                                  Select Operator [SEL_27] (rows=2086007 width=213)
+                                  Select Operator [SEL_27] (rows=1056644 width=155)
                                     Output:["_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col13","_col14","_col15","_col16","_col18","_col19","_col20"]
-                                    Merge Join Operator [MERGEJOIN_176] (rows=2086007 width=213)
+                                    Merge Join Operator [MERGEJOIN_176] (rows=1056644 width=155)
                                       Conds:RS_24._col1, _col13, _col14=RS_199._col0, _col1, _col2(Inner),Output:["_col0","_col4","_col5","_col6","_col7","_col9","_col10","_col11","_col18","_col19","_col20","_col21","_col22","_col23"]
                                     <-Map 14 [SIMPLE_EDGE] vectorized
                                       SHUFFLE [RS_199]
@@ -252,7 +252,7 @@ Stage-0
                                     <-Reducer 11 [SIMPLE_EDGE]
                                       SHUFFLE [RS_24]
                                         PartitionCols:_col1, _col13, _col14
-                                        Merge Join Operator [MERGEJOIN_175] (rows=2086007 width=371)
+                                        Merge Join Operator [MERGEJOIN_175] (rows=1056644 width=312)
                                           Conds:RS_21._col3=RS_200._col0(Inner),Output:["_col0","_col1","_col4","_col5","_col6","_col7","_col9","_col10","_col11","_col13","_col14"]
                                         <-Map 14 [SIMPLE_EDGE] vectorized
                                           SHUFFLE [RS_200]
@@ -263,7 +263,7 @@ Stage-0
                                         <-Reducer 10 [SIMPLE_EDGE]
                                           SHUFFLE [RS_21]
                                             PartitionCols:_col3
-                                            Merge Join Operator [MERGEJOIN_174] (rows=11975292 width=245)
+                                            Merge Join Operator [MERGEJOIN_174] (rows=1056644 width=135)
                                               Conds:RS_192._col2=RS_195._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7","_col9","_col10","_col11"]
                                             <-Map 13 [SIMPLE_EDGE] vectorized
                                               SHUFFLE [RS_195]
@@ -286,7 +286,7 @@ Stage-0
                               <-Reducer 2 [SIMPLE_EDGE]
                                 SHUFFLE [RS_33]
                                   PartitionCols:_col1, _col2
-                                  Merge Join Operator [MERGEJOIN_173] (rows=143931136 width=35)
+                                  Merge Join Operator [MERGEJOIN_173] (rows=51392014 width=35)
                                     Conds:RS_189._col0=RS_181._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
                                   <-Map 7 [SIMPLE_EDGE] vectorized
                                     PARTITION_ONLY_SHUFFLE [RS_181]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query86.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query86.q.out
index 47281f9..a243540 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query86.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query86.q.out
@@ -97,11 +97,11 @@ Stage-0
                           <-Reducer 3 [SIMPLE_EDGE]
                             SHUFFLE [RS_17]
                               PartitionCols:_col0, _col1, _col2
-                              Group By Operator [GBY_16] (rows=507960 width=302)
+                              Group By Operator [GBY_16] (rows=88740 width=302)
                                 Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)"],keys:_col0, _col1, 0L
-                                Select Operator [SEL_14] (rows=143966864 width=293)
+                                Select Operator [SEL_14] (rows=24992810 width=293)
                                   Output:["_col0","_col1","_col2"]
-                                  Merge Join Operator [MERGEJOIN_60] (rows=143966864 width=293)
+                                  Merge Join Operator [MERGEJOIN_60] (rows=24992810 width=293)
                                     Conds:RS_11._col1=RS_73._col0(Inner),Output:["_col2","_col5","_col6"]
                                   <-Map 9 [SIMPLE_EDGE] vectorized
                                     SHUFFLE [RS_73]
@@ -113,7 +113,7 @@ Stage-0
                                   <-Reducer 2 [SIMPLE_EDGE]
                                     SHUFFLE [RS_11]
                                       PartitionCols:_col1
-                                      Merge Join Operator [MERGEJOIN_59] (rows=143966864 width=115)
+                                      Merge Join Operator [MERGEJOIN_59] (rows=24992810 width=115)
                                         Conds:RS_71._col0=RS_63._col0(Inner),Output:["_col1","_col2"]
                                       <-Map 7 [SIMPLE_EDGE] vectorized
                                         PARTITION_ONLY_SHUFFLE [RS_63]
diff --git a/ql/src/test/results/clientpositive/perf/tez/constraints/query87.q.out b/ql/src/test/results/clientpositive/perf/tez/constraints/query87.q.out
index 0bb3ad5..a4127aa 100644
--- a/ql/src/test/results/clientpositive/perf/tez/constraints/query87.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/constraints/query87.q.out
@@ -86,35 +86,35 @@ Stage-0
           PARTITION_ONLY_SHUFFLE [RS_266]
             Group By Operator [GBY_265] (rows=1 width=8)
               Output:["_col0"],aggregations:["count()"]
-              Select Operator [SEL_264] (rows=46500866 width=16)
-                Filter Operator [FIL_263] (rows=46500866 width=16)
+              Select Operator [SEL_264] (rows=8062883 width=16)
+                Filter Operator [FIL_263] (rows=8062883 width=16)
                   predicate:((_col3 > 0L) and ((_col3 * 2L) = _col4))
-                  Select Operator [SEL_262] (rows=279005196 width=16)
+                  Select Operator [SEL_262] (rows=48377300 width=16)
                     Output:["_col3","_col4"]
-                    Group By Operator [GBY_261] (rows=279005196 width=290)
+                    Group By Operator [GBY_261] (rows=48377300 width=290)
                       Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2
                     <-Union 7 [SIMPLE_EDGE]
                       <-Reducer 18 [CONTAINS] vectorized
                         Reduce Output Operator [RS_292]
                           PartitionCols:_col0, _col1, _col2
-                          Group By Operator [GBY_291] (rows=279005196 width=290)
+                          Group By Operator [GBY_291] (rows=48377300 width=290)
                             Output:["_col0","_col1","_col2","_col3","_col4"],aggregations:["sum(_col3)","sum(_col4)"],keys:_col0, _col1, _col2
-                            Select Operator [SEL_290] (rows=279005196 width=290)
+                            Select Operator [SEL_290] (rows=48377300 width=290)
                               Output:["_col0","_col1","_col2","_col3","_col4"]
-                              Select Operator [SEL_289] (rows=143930993 width=290)
+                              Select Operator [SEL_289] (rows=24986582 width=290)
                                 Output:["_col0","_col1","_col2","_col3","_col4"]
-                                Group By Operator [GBY_288] (rows=143930993 width=282)
+                                Group By Operator [GBY_288] (rows=24986582 width=282)
                                   Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col1, _col0, _col2
-                                  Select Operator [SEL_287] (rows=143930993 width=274)
+                                  Select Operator [SEL_287] (rows=24986582 width=274)
                                     Output:["_col0","_col1","_col2"]
-                                    Group By Operator [GBY_286] (rows=143930993 width=274)
+                                    Group By Operator [GBY_286] (rows=24986582 width=274)
                                       Output:["_col0","_col1","_col2"],keys:KEY._col0, KEY._col1, KEY._col2
                                     <-Reducer 17 [SIMPLE_EDGE]
                                       SHUFFLE [RS_77]
                                         PartitionCols:_col0, _col1, _col2
-                                        Group By Operator [GBY_76] (rows=143930993 width=274)
+                                        Group By Operator [GBY_76] (rows=24986582 width=274)
                                           Output:["_col0","_col1","_col2"],keys:_col6, _col5, _col3
-                                          Merge Join Operator [MERGEJOIN_189] (rows=143930993 width=274)
+                                          Merge Join Operator [MERGEJOIN_189] (rows=24986582 width=274)
                                             Conds:RS_72._col1=RS_245._col0(Inner),Output:["_col3","_col5","_col6"]
                                           <-Map 20 [SIMPLE_EDGE] vectorized
                                             SHUFFLE [RS_245]
@@ -126,7 +126,7 @@ Stage-0
                                           <-Reducer 16 [SIMPLE_EDGE]
                                             SHUFFLE [RS_72]
                                               PartitionCols:_col1
-                                              Merge Join Operator [MERGEJOIN_188] (rows=143930993 width=97)
+                                              Merge Join Operator [MERGEJOIN_188] (rows=24986582 width=97)
                                                 Conds:RS_285._col0=RS_229._col0(Inner),Output:["_col1","_col3"]
                                               <-Map 10 [SIMPLE_EDGE] vectorized
                                                 SHUFFLE [RS_229]
@@ -160,42 +160,42 @@ Stage-0
... 10884 lines suppressed ...