You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2015/12/15 23:15:30 UTC

[03/27] hive git commit: HIVE-11107 : Support for Performance regression test suite with TPCDS (Hari Subramaniyan, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query89.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query89.q.out b/ql/src/test/results/clientpositive/perf/query89.q.out
new file mode 100644
index 0000000..4cab575
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query89.q.out
@@ -0,0 +1,224 @@
+PREHOOK: query: explain
+select  *
+from(
+select i_category, i_class, i_brand,
+       s_store_name, s_company_name,
+       d_moy,
+       sum(ss_sales_price) sum_sales,
+       avg(sum(ss_sales_price)) over
+         (partition by i_category, i_brand, s_store_name, s_company_name)
+         avg_monthly_sales
+from item, store_sales, date_dim, store
+where store_sales.ss_item_sk = item.i_item_sk and
+      store_sales.ss_sold_date_sk = date_dim.d_date_sk and
+      store_sales.ss_store_sk = store.s_store_sk and
+      d_year in (2000) and
+        ((i_category in ('Home','Books','Electronics') and
+          i_class in ('wallpaper','parenting','musical')
+         )
+      or (i_category in ('Shoes','Jewelry','Men') and
+          i_class in ('womens','birdal','pants') 
+        ))
+group by i_category, i_class, i_brand,
+         s_store_name, s_company_name, d_moy) tmp1
+where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
+order by sum_sales - avg_monthly_sales, s_store_name
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  *
+from(
+select i_category, i_class, i_brand,
+       s_store_name, s_company_name,
+       d_moy,
+       sum(ss_sales_price) sum_sales,
+       avg(sum(ss_sales_price)) over
+         (partition by i_category, i_brand, s_store_name, s_company_name)
+         avg_monthly_sales
+from item, store_sales, date_dim, store
+where store_sales.ss_item_sk = item.i_item_sk and
+      store_sales.ss_sold_date_sk = date_dim.d_date_sk and
+      store_sales.ss_store_sk = store.s_store_sk and
+      d_year in (2000) and
+        ((i_category in ('Home','Books','Electronics') and
+          i_class in ('wallpaper','parenting','musical')
+         )
+      or (i_category in ('Shoes','Jewelry','Men') and
+          i_class in ('womens','birdal','pants') 
+        ))
+group by i_category, i_class, i_brand,
+         s_store_name, s_company_name, d_moy) tmp1
+where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
+order by sum_sales - avg_monthly_sales, s_store_name
+limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+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 6 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:100
+      Stage-1
+         Reducer 7
+         File Output Operator [FS_42]
+            compressed:false
+            Statistics:Num rows: 100 Data size: 143600 Basic stats: COMPLETE Column stats: NONE
+            table:{"input format:":"org.apache.hadoop.mapred.TextInputFormat","output format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Limit [LIM_41]
+               Number of rows:100
+               Statistics:Num rows: 100 Data size: 143600 Basic stats: COMPLETE Column stats: NONE
+               Select Operator [SEL_40]
+               |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+               |  Statistics:Num rows: 51243 Data size: 73599199 Basic stats: COMPLETE Column stats: NONE
+               |<-Reducer 6 [SIMPLE_EDGE]
+                  Reduce Output Operator [RS_39]
+                     key expressions:(_col6 - _col7) (type: decimal(22,6)), _col3 (type: string)
+                     sort order:++
+                     Statistics:Num rows: 51243 Data size: 73599199 Basic stats: COMPLETE Column stats: NONE
+                     value expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: decimal(17,2)), _col7 (type: decimal(21,6))
+                     Select Operator [SEL_36]
+                        outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                        Statistics:Num rows: 51243 Data size: 73599199 Basic stats: COMPLETE Column stats: NONE
+                        Filter Operator [FIL_52]
+                           predicate:(CASE WHEN ((avg_window_0 <> 0)) THEN ((abs((_col6 - avg_window_0)) / avg_window_0)) ELSE (null) END > 0.1) (type: boolean)
+                           Statistics:Num rows: 51243 Data size: 73599199 Basic stats: COMPLETE Column stats: NONE
+                           Select Operator [SEL_35]
+                              outputColumnNames:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                              Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                              PTF Operator [PTF_34]
+                                 Function definitions:[{"Input definition":{"type:":"WINDOWING"}},{"name:":"windowingtablefunction","order by:":"_col0, _col2, _col3, _col4","partition by:":"_col0, _col2, _col3, _col4"}]
+                                 Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                                 Select Operator [SEL_33]
+                                 |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                 |  Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Reducer 5 [SIMPLE_EDGE]
+                                    Reduce Output Operator [RS_32]
+                                       key expressions:_col0 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string)
+                                       Map-reduce partition columns:_col0 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string)
+                                       sort order:++++
+                                       Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                                       value expressions:_col1 (type: string), _col5 (type: int), _col6 (type: decimal(17,2))
+                                       Select Operator [SEL_31]
+                                          outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                          Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                                          Group By Operator [GBY_30]
+                                          |  aggregations:["sum(VALUE._col0)"]
+                                          |  keys:KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: int), KEY._col4 (type: string), KEY._col5 (type: string)
+                                          |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                          |  Statistics:Num rows: 153730 Data size: 220799036 Basic stats: COMPLETE Column stats: NONE
+                                          |<-Reducer 4 [SIMPLE_EDGE]
+                                             Reduce Output Operator [RS_29]
+                                                key expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: string)
+                                                Map-reduce partition columns:_col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: string)
+                                                sort order:++++++
+                                                Statistics:Num rows: 307461 Data size: 441599510 Basic stats: COMPLETE Column stats: NONE
+                                                value expressions:_col6 (type: decimal(17,2))
+                                                Group By Operator [GBY_28]
+                                                   aggregations:["sum(_col7)"]
+                                                   keys:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col10 (type: int), _col12 (type: string), _col13 (type: string)
+                                                   outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                                                   Statistics:Num rows: 307461 Data size: 441599510 Basic stats: COMPLETE Column stats: NONE
+                                                   Select Operator [SEL_27]
+                                                      outputColumnNames:["_col1","_col2","_col3","_col10","_col12","_col13","_col7"]
+                                                      Statistics:Num rows: 307461 Data size: 441599510 Basic stats: COMPLETE Column stats: NONE
+                                                      Merge Join Operator [MERGEJOIN_59]
+                                                      |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                      |  keys:{"0":"_col6 (type: int)","1":"_col0 (type: int)"}
+                                                      |  outputColumnNames:["_col1","_col2","_col3","_col7","_col10","_col12","_col13"]
+                                                      |  Statistics:Num rows: 307461 Data size: 441599510 Basic stats: COMPLETE Column stats: NONE
+                                                      |<-Map 10 [SIMPLE_EDGE]
+                                                      |  Reduce Output Operator [RS_25]
+                                                      |     key expressions:_col0 (type: int)
+                                                      |     Map-reduce partition columns:_col0 (type: int)
+                                                      |     sort order:+
+                                                      |     Statistics:Num rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                      |     value expressions:_col1 (type: string), _col2 (type: string)
+                                                      |     Select Operator [SEL_11]
+                                                      |        outputColumnNames:["_col0","_col1","_col2"]
+                                                      |        Statistics:Num rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                      |        Filter Operator [FIL_56]
+                                                      |           predicate:s_store_sk is not null (type: boolean)
+                                                      |           Statistics:Num rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                      |           TableScan [TS_9]
+                                                      |              alias:store
+                                                      |              Statistics:Num rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                      |<-Reducer 3 [SIMPLE_EDGE]
+                                                         Reduce Output Operator [RS_23]
+                                                            key expressions:_col6 (type: int)
+                                                            Map-reduce partition columns:_col6 (type: int)
+                                                            sort order:+
+                                                            Statistics:Num rows: 279510 Data size: 401454092 Basic stats: COMPLETE Column stats: NONE
+                                                            value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: decimal(7,2)), _col10 (type: int)
+                                                            Merge Join Operator [MERGEJOIN_58]
+                                                            |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                            |  keys:{"0":"_col4 (type: int)","1":"_col0 (type: int)"}
+                                                            |  outputColumnNames:["_col1","_col2","_col3","_col6","_col7","_col10"]
+                                                            |  Statistics:Num rows: 279510 Data size: 401454092 Basic stats: COMPLETE Column stats: NONE
+                                                            |<-Map 9 [SIMPLE_EDGE]
+                                                            |  Reduce Output Operator [RS_20]
+                                                            |     key expressions:_col0 (type: int)
+                                                            |     Map-reduce partition columns:_col0 (type: int)
+                                                            |     sort order:+
+                                                            |     Statistics:Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                                            |     value expressions:_col2 (type: int)
+                                                            |     Select Operator [SEL_8]
+                                                            |        outputColumnNames:["_col0","_col2"]
+                                                            |        Statistics:Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                                            |        Filter Operator [FIL_55]
+                                                            |           predicate:((d_year) IN (2000) and d_date_sk is not null) (type: boolean)
+                                                            |           Statistics:Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                                            |           TableScan [TS_6]
+                                                            |              alias:date_dim
+                                                            |              Statistics:Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                                                            |<-Reducer 2 [SIMPLE_EDGE]
+                                                               Reduce Output Operator [RS_18]
+                                                                  key expressions:_col4 (type: int)
+                                                                  Map-reduce partition columns:_col4 (type: int)
+                                                                  sort order:+
+                                                                  Statistics:Num rows: 254100 Data size: 364958258 Basic stats: COMPLETE Column stats: NONE
+                                                                  value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col6 (type: int), _col7 (type: decimal(7,2))
+                                                                  Merge Join Operator [MERGEJOIN_57]
+                                                                  |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                                  |  keys:{"0":"_col0 (type: int)","1":"_col1 (type: int)"}
+                                                                  |  outputColumnNames:["_col1","_col2","_col3","_col4","_col6","_col7"]
+                                                                  |  Statistics:Num rows: 254100 Data size: 364958258 Basic stats: COMPLETE Column stats: NONE
+                                                                  |<-Map 1 [SIMPLE_EDGE]
+                                                                  |  Reduce Output Operator [RS_13]
+                                                                  |     key expressions:_col0 (type: int)
+                                                                  |     Map-reduce partition columns:_col0 (type: int)
+                                                                  |     sort order:+
+                                                                  |     Statistics:Num rows: 231000 Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                                                  |     value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string)
+                                                                  |     Select Operator [SEL_2]
+                                                                  |        outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                                  |        Statistics:Num rows: 231000 Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                                                  |        Filter Operator [FIL_53]
+                                                                  |           predicate:((((((i_category) IN ('Home', 'Books', 'Electronics') and (i_class) IN ('wallpaper', 'parenting', 'musical')) or ((i_category) IN ('Shoes', 'Jewelry', 'Men') and (i_class) IN ('womens', 'birdal', 'pants'))) and ((i_category) IN ('Home', 'Books', 'Electronics') or (i_category) IN ('Shoes', 'Jewelry', 'Men'))) and ((i_class) IN ('wallpaper', 'parenting', 'musical') or (i_class) IN ('womens', 'birdal', 'pants'))) and i_item_sk is not null) (type: boolean)
+                                                                  |           Statistics:Num rows: 231000 Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                                                  |           TableScan [TS_0]
+                                                                  |              alias:item
+                                                                  |              Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                                                  |<-Map 8 [SIMPLE_EDGE]
+                                                                     Reduce Output Operator [RS_15]
+                                                                        key expressions:_col1 (type: int)
+                                                                        Map-reduce partition columns:_col1 (type: int)
+                                                                        sort order:+
+                                                                        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                        value expressions:_col0 (type: int), _col2 (type: int), _col3 (type: decimal(7,2))
+                                                                        Select Operator [SEL_5]
+                                                                           outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                                           Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                           Filter Operator [FIL_54]
+                                                                              predicate:((ss_item_sk is not null and ss_sold_date_sk is not null) and ss_store_sk is not null) (type: boolean)
+                                                                              Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                              TableScan [TS_3]
+                                                                                 alias:store_sales
+                                                                                 Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query90.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query90.q.out b/ql/src/test/results/clientpositive/perf/query90.q.out
new file mode 100644
index 0000000..2c0f592
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query90.q.out
@@ -0,0 +1,260 @@
+Warning: Shuffle Join MERGEJOIN[106][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 6' is a cross product
+PREHOOK: query: explain select cast(amc as decimal(15,4))/cast(pmc as decimal(15,4)) am_pm_ratio from ( select count(*) amc from web_sales, household_demographics , time_dim, web_page where ws_sold_time_sk = time_dim.t_time_sk and ws_ship_hdemo_sk = household_demographics.hd_demo_sk and ws_web_page_sk = web_page.wp_web_page_sk and time_dim.t_hour between 6 and 6+1 and household_demographics.hd_dep_count = 8 and web_page.wp_char_count between 5000 and 5200) at, ( select count(*) pmc from web_sales, household_demographics , time_dim, web_page where ws_sold_time_sk = time_dim.t_time_sk and ws_ship_hdemo_sk = household_demographics.hd_demo_sk and ws_web_page_sk = web_page.wp_web_page_sk and time_dim.t_hour between 14 and 14+1 and household_demographics.hd_dep_count = 8 and web_page.wp_char_count between 5000 and 5200) pt order by am_pm_ratio limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select cast(amc as decimal(15,4))/cast(pmc as decimal(15,4)) am_pm_ratio from ( select count(*) amc from web_sales, household_demographics , time_dim, web_page where ws_sold_time_sk = time_dim.t_time_sk and ws_ship_hdemo_sk = household_demographics.hd_demo_sk and ws_web_page_sk = web_page.wp_web_page_sk and time_dim.t_hour between 6 and 6+1 and household_demographics.hd_dep_count = 8 and web_page.wp_char_count between 5000 and 5200) at, ( select count(*) pmc from web_sales, household_demographics , time_dim, web_page where ws_sold_time_sk = time_dim.t_time_sk and ws_ship_hdemo_sk = household_demographics.hd_demo_sk and ws_web_page_sk = web_page.wp_web_page_sk and time_dim.t_hour between 14 and 14+1 and household_demographics.hd_dep_count = 8 and web_page.wp_char_count between 5000 and 5200) pt order by am_pm_ratio limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 16 (SIMPLE_EDGE)
+Reducer 13 <- Map 17 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE)
+Reducer 14 <- Map 18 (SIMPLE_EDGE), Reducer 13 (SIMPLE_EDGE)
+Reducer 15 <- Reducer 14 (SIMPLE_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 15 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:100
+      Stage-1
+         Reducer 7
+         File Output Operator [FS_72]
+            compressed:false
+            Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+            table:{"input format:":"org.apache.hadoop.mapred.TextInputFormat","output format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Limit [LIM_71]
+               Number of rows:100
+               Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+               Select Operator [SEL_70]
+               |  outputColumnNames:["_col0"]
+               |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+               |<-Reducer 6 [SIMPLE_EDGE]
+                  Reduce Output Operator [RS_69]
+                     key expressions:_col0 (type: decimal(35,20))
+                     sort order:+
+                     Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                     Select Operator [SEL_68]
+                        outputColumnNames:["_col0"]
+                        Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Merge Join Operator [MERGEJOIN_106]
+                        |  condition map:[{"":"Inner Join 0 to 1"}]
+                        |  keys:{}
+                        |  outputColumnNames:["_col0","_col1"]
+                        |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        |<-Reducer 15 [SIMPLE_EDGE]
+                        |  Reduce Output Operator [RS_66]
+                        |     sort order:
+                        |     Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        |     value expressions:_col0 (type: bigint)
+                        |     Group By Operator [GBY_62]
+                        |     |  aggregations:["count(VALUE._col0)"]
+                        |     |  outputColumnNames:["_col0"]
+                        |     |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        |     |<-Reducer 14 [SIMPLE_EDGE]
+                        |        Reduce Output Operator [RS_61]
+                        |           sort order:
+                        |           Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        |           value expressions:_col0 (type: bigint)
+                        |           Group By Operator [GBY_60]
+                        |              aggregations:["count()"]
+                        |              outputColumnNames:["_col0"]
+                        |              Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        |              Merge Join Operator [MERGEJOIN_105]
+                        |              |  condition map:[{"":"Inner Join 0 to 1"}]
+                        |              |  keys:{"0":"_col2 (type: int)","1":"_col0 (type: int)"}
+                        |              |  Statistics:Num rows: 52272 Data size: 24620112 Basic stats: COMPLETE Column stats: NONE
+                        |              |<-Map 18 [SIMPLE_EDGE]
+                        |              |  Reduce Output Operator [RS_57]
+                        |              |     key expressions:_col0 (type: int)
+                        |              |     Map-reduce partition columns:_col0 (type: int)
+                        |              |     sort order:+
+                        |              |     Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                        |              |     Select Operator [SEL_43]
+                        |              |        outputColumnNames:["_col0"]
+                        |              |        Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                        |              |        Filter Operator [FIL_99]
+                        |              |           predicate:(wp_char_count BETWEEN 5000 AND 5200 and wp_web_page_sk is not null) (type: boolean)
+                        |              |           Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                        |              |           TableScan [TS_41]
+                        |              |              alias:web_page
+                        |              |              Statistics:Num rows: 4602 Data size: 2696178 Basic stats: COMPLETE Column stats: NONE
+                        |              |<-Reducer 13 [SIMPLE_EDGE]
+                        |                 Reduce Output Operator [RS_55]
+                        |                    key expressions:_col2 (type: int)
+                        |                    Map-reduce partition columns:_col2 (type: int)
+                        |                    sort order:+
+                        |                    Statistics:Num rows: 47520 Data size: 22381920 Basic stats: COMPLETE Column stats: NONE
+                        |                    Merge Join Operator [MERGEJOIN_104]
+                        |                    |  condition map:[{"":"Inner Join 0 to 1"}]
+                        |                    |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                        |                    |  outputColumnNames:["_col2"]
+                        |                    |  Statistics:Num rows: 47520 Data size: 22381920 Basic stats: COMPLETE Column stats: NONE
+                        |                    |<-Map 17 [SIMPLE_EDGE]
+                        |                    |  Reduce Output Operator [RS_52]
+                        |                    |     key expressions:_col0 (type: int)
+                        |                    |     Map-reduce partition columns:_col0 (type: int)
+                        |                    |     sort order:+
+                        |                    |     Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                        |                    |     Select Operator [SEL_40]
+                        |                    |        outputColumnNames:["_col0"]
+                        |                    |        Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                        |                    |        Filter Operator [FIL_98]
+                        |                    |           predicate:(t_hour BETWEEN 14 AND 15 and t_time_sk is not null) (type: boolean)
+                        |                    |           Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                        |                    |           TableScan [TS_38]
+                        |                    |              alias:time_dim
+                        |                    |              Statistics:Num rows: 86400 Data size: 40694400 Basic stats: COMPLETE Column stats: NONE
+                        |                    |<-Reducer 12 [SIMPLE_EDGE]
+                        |                       Reduce Output Operator [RS_50]
+                        |                          key expressions:_col0 (type: int)
+                        |                          Map-reduce partition columns:_col0 (type: int)
+                        |                          sort order:+
+                        |                          Statistics:Num rows: 3960 Data size: 423720 Basic stats: COMPLETE Column stats: NONE
+                        |                          value expressions:_col2 (type: int)
+                        |                          Merge Join Operator [MERGEJOIN_103]
+                        |                          |  condition map:[{"":"Inner Join 0 to 1"}]
+                        |                          |  keys:{"0":"_col1 (type: int)","1":"_col0 (type: int)"}
+                        |                          |  outputColumnNames:["_col0","_col2"]
+                        |                          |  Statistics:Num rows: 3960 Data size: 423720 Basic stats: COMPLETE Column stats: NONE
+                        |                          |<-Map 11 [SIMPLE_EDGE]
+                        |                          |  Reduce Output Operator [RS_45]
+                        |                          |     key expressions:_col1 (type: int)
+                        |                          |     Map-reduce partition columns:_col1 (type: int)
+                        |                          |     sort order:+
+                        |                          |     Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                          |     value expressions:_col0 (type: int), _col2 (type: int)
+                        |                          |     Select Operator [SEL_34]
+                        |                          |        outputColumnNames:["_col0","_col1","_col2"]
+                        |                          |        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                          |        Filter Operator [FIL_96]
+                        |                          |           predicate:((ws_ship_hdemo_sk is not null and ws_sold_time_sk is not null) and ws_web_page_sk is not null) (type: boolean)
+                        |                          |           Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                          |           TableScan [TS_32]
+                        |                          |              alias:web_sales
+                        |                          |              Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                          |<-Map 16 [SIMPLE_EDGE]
+                        |                             Reduce Output Operator [RS_47]
+                        |                                key expressions:_col0 (type: int)
+                        |                                Map-reduce partition columns:_col0 (type: int)
+                        |                                sort order:+
+                        |                                Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                        |                                Select Operator [SEL_37]
+                        |                                   outputColumnNames:["_col0"]
+                        |                                   Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                        |                                   Filter Operator [FIL_97]
+                        |                                      predicate:((hd_dep_count = 8) and hd_demo_sk is not null) (type: boolean)
+                        |                                      Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                        |                                      TableScan [TS_35]
+                        |                                         alias:household_demographics
+                        |                                         Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: NONE
+                        |<-Reducer 5 [SIMPLE_EDGE]
+                           Reduce Output Operator [RS_65]
+                              sort order:
+                              Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                              value expressions:_col0 (type: bigint)
+                              Group By Operator [GBY_30]
+                              |  aggregations:["count(VALUE._col0)"]
+                              |  outputColumnNames:["_col0"]
+                              |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                              |<-Reducer 4 [SIMPLE_EDGE]
+                                 Reduce Output Operator [RS_29]
+                                    sort order:
+                                    Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                                    value expressions:_col0 (type: bigint)
+                                    Group By Operator [GBY_28]
+                                       aggregations:["count()"]
+                                       outputColumnNames:["_col0"]
+                                       Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                                       Merge Join Operator [MERGEJOIN_102]
+                                       |  condition map:[{"":"Inner Join 0 to 1"}]
+                                       |  keys:{"0":"_col2 (type: int)","1":"_col0 (type: int)"}
+                                       |  Statistics:Num rows: 52272 Data size: 24620112 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 10 [SIMPLE_EDGE]
+                                       |  Reduce Output Operator [RS_25]
+                                       |     key expressions:_col0 (type: int)
+                                       |     Map-reduce partition columns:_col0 (type: int)
+                                       |     sort order:+
+                                       |     Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                                       |     Select Operator [SEL_11]
+                                       |        outputColumnNames:["_col0"]
+                                       |        Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                                       |        Filter Operator [FIL_95]
+                                       |           predicate:(wp_char_count BETWEEN 5000 AND 5200 and wp_web_page_sk is not null) (type: boolean)
+                                       |           Statistics:Num rows: 2301 Data size: 1348089 Basic stats: COMPLETE Column stats: NONE
+                                       |           TableScan [TS_9]
+                                       |              alias:web_page
+                                       |              Statistics:Num rows: 4602 Data size: 2696178 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Reducer 3 [SIMPLE_EDGE]
+                                          Reduce Output Operator [RS_23]
+                                             key expressions:_col2 (type: int)
+                                             Map-reduce partition columns:_col2 (type: int)
+                                             sort order:+
+                                             Statistics:Num rows: 47520 Data size: 22381920 Basic stats: COMPLETE Column stats: NONE
+                                             Merge Join Operator [MERGEJOIN_101]
+                                             |  condition map:[{"":"Inner Join 0 to 1"}]
+                                             |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                                             |  outputColumnNames:["_col2"]
+                                             |  Statistics:Num rows: 47520 Data size: 22381920 Basic stats: COMPLETE Column stats: NONE
+                                             |<-Map 9 [SIMPLE_EDGE]
+                                             |  Reduce Output Operator [RS_20]
+                                             |     key expressions:_col0 (type: int)
+                                             |     Map-reduce partition columns:_col0 (type: int)
+                                             |     sort order:+
+                                             |     Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                                             |     Select Operator [SEL_8]
+                                             |        outputColumnNames:["_col0"]
+                                             |        Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                                             |        Filter Operator [FIL_94]
+                                             |           predicate:(t_time_sk is not null and t_hour BETWEEN 6 AND 7) (type: boolean)
+                                             |           Statistics:Num rows: 43200 Data size: 20347200 Basic stats: COMPLETE Column stats: NONE
+                                             |           TableScan [TS_6]
+                                             |              alias:time_dim
+                                             |              Statistics:Num rows: 86400 Data size: 40694400 Basic stats: COMPLETE Column stats: NONE
+                                             |<-Reducer 2 [SIMPLE_EDGE]
+                                                Reduce Output Operator [RS_18]
+                                                   key expressions:_col0 (type: int)
+                                                   Map-reduce partition columns:_col0 (type: int)
+                                                   sort order:+
+                                                   Statistics:Num rows: 3960 Data size: 423720 Basic stats: COMPLETE Column stats: NONE
+                                                   value expressions:_col2 (type: int)
+                                                   Merge Join Operator [MERGEJOIN_100]
+                                                   |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                   |  keys:{"0":"_col1 (type: int)","1":"_col0 (type: int)"}
+                                                   |  outputColumnNames:["_col0","_col2"]
+                                                   |  Statistics:Num rows: 3960 Data size: 423720 Basic stats: COMPLETE Column stats: NONE
+                                                   |<-Map 1 [SIMPLE_EDGE]
+                                                   |  Reduce Output Operator [RS_13]
+                                                   |     key expressions:_col1 (type: int)
+                                                   |     Map-reduce partition columns:_col1 (type: int)
+                                                   |     sort order:+
+                                                   |     Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   |     value expressions:_col0 (type: int), _col2 (type: int)
+                                                   |     Select Operator [SEL_2]
+                                                   |        outputColumnNames:["_col0","_col1","_col2"]
+                                                   |        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   |        Filter Operator [FIL_92]
+                                                   |           predicate:((ws_ship_hdemo_sk is not null and ws_sold_time_sk is not null) and ws_web_page_sk is not null) (type: boolean)
+                                                   |           Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   |           TableScan [TS_0]
+                                                   |              alias:web_sales
+                                                   |              Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   |<-Map 8 [SIMPLE_EDGE]
+                                                      Reduce Output Operator [RS_15]
+                                                         key expressions:_col0 (type: int)
+                                                         Map-reduce partition columns:_col0 (type: int)
+                                                         sort order:+
+                                                         Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                                         Select Operator [SEL_5]
+                                                            outputColumnNames:["_col0"]
+                                                            Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                                            Filter Operator [FIL_93]
+                                                               predicate:((hd_dep_count = 8) and hd_demo_sk is not null) (type: boolean)
+                                                               Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                                               TableScan [TS_3]
+                                                                  alias:household_demographics
+                                                                  Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query91.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query91.q.out b/ql/src/test/results/clientpositive/perf/query91.q.out
new file mode 100644
index 0000000..e2326b4
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query91.q.out
@@ -0,0 +1,232 @@
+PREHOOK: query: explain select cc_call_center_id Call_Center, cc_name Call_Center_Name, cc_manager Manager, sum(cr_net_loss) Returns_Loss from call_center, catalog_returns, date_dim, customer, customer_address, customer_demographics, household_demographics where catalog_returns.cr_call_center_sk = call_center.cc_call_center_sk and catalog_returns.cr_returned_date_sk = date_dim.d_date_sk and catalog_returns.cr_returning_customer_sk= customer.c_customer_sk and customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk and household_demographics.hd_demo_sk = customer.c_current_hdemo_sk and customer_address.ca_address_sk = customer.c_current_addr_sk and d_year = 1999 and d_moy = 11 and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown') or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree')) and hd_buy_potential like '0-500%' and ca_gmt_offset = -7 group by cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status order by Returns_Loss d
 esc
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select cc_call_center_id Call_Center, cc_name Call_Center_Name, cc_manager Manager, sum(cr_net_loss) Returns_Loss from call_center, catalog_returns, date_dim, customer, customer_address, customer_demographics, household_demographics where catalog_returns.cr_call_center_sk = call_center.cc_call_center_sk and catalog_returns.cr_returned_date_sk = date_dim.d_date_sk and catalog_returns.cr_returning_customer_sk= customer.c_customer_sk and customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk and household_demographics.hd_demo_sk = customer.c_current_hdemo_sk and customer_address.ca_address_sk = customer.c_current_addr_sk and d_year = 1999 and d_moy = 11 and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown') or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree')) and hd_buy_potential like '0-500%' and ca_gmt_offset = -7 group by cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status order by Returns_Loss 
 desc
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 3 <- Map 11 (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 <- Map 14 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Map 15 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
+Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:-1
+      Stage-1
+         Reducer 9
+         File Output Operator [FS_58]
+            compressed:false
+            Statistics:Num rows: 58564004 Data size: 50366227250 Basic stats: COMPLETE Column stats: NONE
+            table:{"input format:":"org.apache.hadoop.mapred.TextInputFormat","output format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Select Operator [SEL_57]
+            |  outputColumnNames:["_col0","_col1","_col2","_col3"]
+            |  Statistics:Num rows: 58564004 Data size: 50366227250 Basic stats: COMPLETE Column stats: NONE
+            |<-Reducer 8 [SIMPLE_EDGE]
+               Reduce Output Operator [RS_56]
+                  key expressions:_col3 (type: decimal(17,2))
+                  sort order:-
+                  Statistics:Num rows: 58564004 Data size: 50366227250 Basic stats: COMPLETE Column stats: NONE
+                  value expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string)
+                  Select Operator [SEL_55]
+                     outputColumnNames:["_col0","_col1","_col2","_col3"]
+                     Statistics:Num rows: 58564004 Data size: 50366227250 Basic stats: COMPLETE Column stats: NONE
+                     Group By Operator [GBY_54]
+                     |  aggregations:["sum(VALUE._col0)"]
+                     |  keys:KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: string)
+                     |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                     |  Statistics:Num rows: 58564004 Data size: 50366227250 Basic stats: COMPLETE Column stats: NONE
+                     |<-Reducer 7 [SIMPLE_EDGE]
+                        Reduce Output Operator [RS_53]
+                           key expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string)
+                           Map-reduce partition columns:_col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string)
+                           sort order:+++++
+                           Statistics:Num rows: 117128008 Data size: 100732454500 Basic stats: COMPLETE Column stats: NONE
+                           value expressions:_col5 (type: decimal(17,2))
+                           Group By Operator [GBY_52]
+                              aggregations:["sum(_col7)"]
+                              keys:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col18 (type: string), _col19 (type: string)
+                              outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                              Statistics:Num rows: 117128008 Data size: 100732454500 Basic stats: COMPLETE Column stats: NONE
+                              Select Operator [SEL_51]
+                                 outputColumnNames:["_col1","_col2","_col3","_col18","_col19","_col7"]
+                                 Statistics:Num rows: 117128008 Data size: 100732454500 Basic stats: COMPLETE Column stats: NONE
+                                 Merge Join Operator [MERGEJOIN_98]
+                                 |  condition map:[{"":"Inner Join 0 to 1"}]
+                                 |  keys:{"0":"_col13 (type: int)","1":"_col0 (type: int)"}
+                                 |  outputColumnNames:["_col1","_col2","_col3","_col7","_col18","_col19"]
+                                 |  Statistics:Num rows: 117128008 Data size: 100732454500 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Map 15 [SIMPLE_EDGE]
+                                 |  Reduce Output Operator [RS_49]
+                                 |     key expressions:_col0 (type: int)
+                                 |     Map-reduce partition columns:_col0 (type: int)
+                                 |     sort order:+
+                                 |     Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                 |     Select Operator [SEL_20]
+                                 |        outputColumnNames:["_col0"]
+                                 |        Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                 |        Filter Operator [FIL_92]
+                                 |           predicate:(hd_demo_sk is not null and (hd_buy_potential like '0-500%')) (type: boolean)
+                                 |           Statistics:Num rows: 3600 Data size: 385200 Basic stats: COMPLETE Column stats: NONE
+                                 |           TableScan [TS_18]
+                                 |              alias:household_demographics
+                                 |              Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Reducer 6 [SIMPLE_EDGE]
+                                    Reduce Output Operator [RS_47]
+                                       key expressions:_col13 (type: int)
+                                       Map-reduce partition columns:_col13 (type: int)
+                                       sort order:+
+                                       Statistics:Num rows: 106480005 Data size: 91574956652 Basic stats: COMPLETE Column stats: NONE
+                                       value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: decimal(7,2)), _col18 (type: string), _col19 (type: string)
+                                       Merge Join Operator [MERGEJOIN_97]
+                                       |  condition map:[{"":"Inner Join 0 to 1"}]
+                                       |  keys:{"0":"_col12 (type: int)","1":"_col0 (type: int)"}
+                                       |  outputColumnNames:["_col1","_col2","_col3","_col7","_col13","_col18","_col19"]
+                                       |  Statistics:Num rows: 106480005 Data size: 91574956652 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 14 [SIMPLE_EDGE]
+                                       |  Reduce Output Operator [RS_44]
+                                       |     key expressions:_col0 (type: int)
+                                       |     Map-reduce partition columns:_col0 (type: int)
+                                       |     sort order:+
+                                       |     Statistics:Num rows: 9900 Data size: 3585529 Basic stats: COMPLETE Column stats: NONE
+                                       |     value expressions:_col1 (type: string), _col2 (type: string)
+                                       |     Select Operator [SEL_17]
+                                       |        outputColumnNames:["_col0","_col1","_col2"]
+                                       |        Statistics:Num rows: 9900 Data size: 3585529 Basic stats: COMPLETE Column stats: NONE
+                                       |        Filter Operator [FIL_91]
+                                       |           predicate:((((((cd_marital_status = 'M') and (cd_education_status = 'Unknown')) or ((cd_marital_status = 'W') and (cd_education_status = 'Advanced Degree'))) and ((cd_education_status = 'Unknown') or (cd_education_status = 'Advanced Degree'))) and ((cd_marital_status = 'M') or (cd_marital_status = 'W'))) and cd_demo_sk is not null) (type: boolean)
+                                       |           Statistics:Num rows: 9900 Data size: 3585529 Basic stats: COMPLETE Column stats: NONE
+                                       |           TableScan [TS_15]
+                                       |              alias:customer_demographics
+                                       |              Statistics:Num rows: 19800 Data size: 7171059 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Reducer 5 [SIMPLE_EDGE]
+                                          Reduce Output Operator [RS_42]
+                                             key expressions:_col12 (type: int)
+                                             Map-reduce partition columns:_col12 (type: int)
+                                             sort order:+
+                                             Statistics:Num rows: 96800003 Data size: 83249958789 Basic stats: COMPLETE Column stats: NONE
+                                             value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: decimal(7,2)), _col13 (type: int)
+                                             Merge Join Operator [MERGEJOIN_96]
+                                             |  condition map:[{"":"Inner Join 0 to 1"}]
+                                             |  keys:{"0":"_col14 (type: int)","1":"_col0 (type: int)"}
+                                             |  outputColumnNames:["_col1","_col2","_col3","_col7","_col12","_col13"]
+                                             |  Statistics:Num rows: 96800003 Data size: 83249958789 Basic stats: COMPLETE Column stats: NONE
+                                             |<-Map 13 [SIMPLE_EDGE]
+                                             |  Reduce Output Operator [RS_39]
+                                             |     key expressions:_col0 (type: int)
+                                             |     Map-reduce partition columns:_col0 (type: int)
+                                             |     sort order:+
+                                             |     Statistics:Num rows: 20000000 Data size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                             |     Select Operator [SEL_14]
+                                             |        outputColumnNames:["_col0"]
+                                             |        Statistics:Num rows: 20000000 Data size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                             |        Filter Operator [FIL_90]
+                                             |           predicate:((ca_gmt_offset = -7) and ca_address_sk is not null) (type: boolean)
+                                             |           Statistics:Num rows: 20000000 Data size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                             |           TableScan [TS_12]
+                                             |              alias:customer_address
+                                             |              Statistics:Num rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                             |<-Reducer 4 [SIMPLE_EDGE]
+                                                Reduce Output Operator [RS_37]
+                                                   key expressions:_col14 (type: int)
+                                                   Map-reduce partition columns:_col14 (type: int)
+                                                   sort order:+
+                                                   Statistics:Num rows: 88000001 Data size: 75681779077 Basic stats: COMPLETE Column stats: NONE
+                                                   value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: decimal(7,2)), _col12 (type: int), _col13 (type: int)
+                                                   Merge Join Operator [MERGEJOIN_95]
+                                                   |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                   |  keys:{"0":"_col5 (type: int)","1":"_col0 (type: int)"}
+                                                   |  outputColumnNames:["_col1","_col2","_col3","_col7","_col12","_col13","_col14"]
+                                                   |  Statistics:Num rows: 88000001 Data size: 75681779077 Basic stats: COMPLETE Column stats: NONE
+                                                   |<-Map 12 [SIMPLE_EDGE]
+                                                   |  Reduce Output Operator [RS_34]
+                                                   |     key expressions:_col0 (type: int)
+                                                   |     Map-reduce partition columns:_col0 (type: int)
+                                                   |     sort order:+
+                                                   |     Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                   |     value expressions:_col1 (type: int), _col2 (type: int), _col3 (type: int)
+                                                   |     Select Operator [SEL_11]
+                                                   |        outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                   |        Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                   |        Filter Operator [FIL_89]
+                                                   |           predicate:(((c_customer_sk is not null and c_current_addr_sk is not null) and c_current_cdemo_sk is not null) and c_current_hdemo_sk is not null) (type: boolean)
+                                                   |           Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                   |           TableScan [TS_9]
+                                                   |              alias:customer
+                                                   |              Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                   |<-Reducer 3 [SIMPLE_EDGE]
+                                                      Reduce Output Operator [RS_32]
+                                                         key expressions:_col5 (type: int)
+                                                         Map-reduce partition columns:_col5 (type: int)
+                                                         sort order:+
+                                                         Statistics:Num rows: 20088 Data size: 22478696 Basic stats: COMPLETE Column stats: NONE
+                                                         value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: decimal(7,2))
+                                                         Merge Join Operator [MERGEJOIN_94]
+                                                         |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                         |  keys:{"0":"_col4 (type: int)","1":"_col0 (type: int)"}
+                                                         |  outputColumnNames:["_col1","_col2","_col3","_col5","_col7"]
+                                                         |  Statistics:Num rows: 20088 Data size: 22478696 Basic stats: COMPLETE Column stats: NONE
+                                                         |<-Map 11 [SIMPLE_EDGE]
+                                                         |  Reduce Output Operator [RS_29]
+                                                         |     key expressions:_col0 (type: int)
+                                                         |     Map-reduce partition columns:_col0 (type: int)
+                                                         |     sort order:+
+                                                         |     Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                                         |     Select Operator [SEL_8]
+                                                         |        outputColumnNames:["_col0"]
+                                                         |        Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                                         |        Filter Operator [FIL_88]
+                                                         |           predicate:(((d_moy = 11) and d_date_sk is not null) and (d_year = 1999)) (type: boolean)
+                                                         |           Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                                         |           TableScan [TS_6]
+                                                         |              alias:date_dim
+                                                         |              Statistics:Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                                                         |<-Reducer 2 [SIMPLE_EDGE]
+                                                            Reduce Output Operator [RS_27]
+                                                               key expressions:_col4 (type: int)
+                                                               Map-reduce partition columns:_col4 (type: int)
+                                                               sort order:+
+                                                               Statistics:Num rows: 66 Data size: 134970 Basic stats: COMPLETE Column stats: NONE
+                                                               value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int), _col7 (type: decimal(7,2))
+                                                               Merge Join Operator [MERGEJOIN_93]
+                                                               |  condition map:[{"":"Inner Join 0 to 1"}]
+                                                               |  keys:{"0":"_col0 (type: int)","1":"_col2 (type: int)"}
+                                                               |  outputColumnNames:["_col1","_col2","_col3","_col4","_col5","_col7"]
+                                                               |  Statistics:Num rows: 66 Data size: 134970 Basic stats: COMPLETE Column stats: NONE
+                                                               |<-Map 1 [SIMPLE_EDGE]
+                                                               |  Reduce Output Operator [RS_22]
+                                                               |     key expressions:_col0 (type: int)
+                                                               |     Map-reduce partition columns:_col0 (type: int)
+                                                               |     sort order:+
+                                                               |     Statistics:Num rows: 60 Data size: 122700 Basic stats: COMPLETE Column stats: NONE
+                                                               |     value expressions:_col1 (type: string), _col2 (type: string), _col3 (type: string)
+                                                               |     Select Operator [SEL_2]
+                                                               |        outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                               |        Statistics:Num rows: 60 Data size: 122700 Basic stats: COMPLETE Column stats: NONE
+                                                               |        Filter Operator [FIL_86]
+                                                               |           predicate:cc_call_center_sk is not null (type: boolean)
+                                                               |           Statistics:Num rows: 60 Data size: 122700 Basic stats: COMPLETE Column stats: NONE
+                                                               |           TableScan [TS_0]
+                                                               |              alias:call_center
+                                                               |              Statistics:Num rows: 60 Data size: 122700 Basic stats: COMPLETE Column stats: NONE
+                                                               |<-Map 10 [SIMPLE_EDGE]
+                                                                  Reduce Output Operator [RS_24]
+                                                                     key expressions:_col2 (type: int)
+                                                                     Map-reduce partition columns:_col2 (type: int)
+                                                                     sort order:+
+                                                                     Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                     value expressions:_col0 (type: int), _col1 (type: int), _col3 (type: decimal(7,2))
+                                                                     Select Operator [SEL_5]
+                                                                        outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                                        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                        Filter Operator [FIL_87]
+                                                                           predicate:((cr_call_center_sk is not null and cr_returned_date_sk is not null) and cr_returning_customer_sk is not null) (type: boolean)
+                                                                           Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                           TableScan [TS_3]
+                                                                              alias:catalog_returns
+                                                                              Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query92.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query92.q.out b/ql/src/test/results/clientpositive/perf/query92.q.out
new file mode 100644
index 0000000..9ea3adc
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query92.q.out
@@ -0,0 +1,160 @@
+PREHOOK: query: explain SELECT sum(case when ssci.customer_sk is not null and csci.customer_sk is null then 1 else 0 end) as store_only, sum(case when ssci.customer_sk is null and csci.customer_sk is not null then 1 else 0 end) as catalog_only, sum(case when ssci.customer_sk is not null and csci.customer_sk is not null then 1 else 0 end) as store_and_catalog FROM (SELECT ss.ss_customer_sk as customer_sk, ss.ss_item_sk as item_sk FROM store_sales ss JOIN date_dim d1 ON (ss.ss_sold_date_sk = d1.d_date_sk) WHERE d1.d_month_seq >= 1206 and d1.d_month_seq <= 1217 GROUP BY ss.ss_customer_sk, ss.ss_item_sk) ssci FULL OUTER JOIN (SELECT cs.cs_bill_customer_sk as customer_sk, cs.cs_item_sk as item_sk FROM catalog_sales cs JOIN date_dim d2 ON (cs.cs_sold_date_sk = d2.d_date_sk) WHERE d2.d_month_seq >= 1206 and d2.d_month_seq <= 1217 GROUP BY cs.cs_bill_customer_sk, cs.cs_item_sk) csci ON (ssci.customer_sk=csci.customer_sk and ssci.item_sk = csci.item_sk)
+PREHOOK: type: QUERY
+POSTHOOK: query: explain SELECT sum(case when ssci.customer_sk is not null and csci.customer_sk is null then 1 else 0 end) as store_only, sum(case when ssci.customer_sk is null and csci.customer_sk is not null then 1 else 0 end) as catalog_only, sum(case when ssci.customer_sk is not null and csci.customer_sk is not null then 1 else 0 end) as store_and_catalog FROM (SELECT ss.ss_customer_sk as customer_sk, ss.ss_item_sk as item_sk FROM store_sales ss JOIN date_dim d1 ON (ss.ss_sold_date_sk = d1.d_date_sk) WHERE d1.d_month_seq >= 1206 and d1.d_month_seq <= 1217 GROUP BY ss.ss_customer_sk, ss.ss_item_sk) ssci FULL OUTER JOIN (SELECT cs.cs_bill_customer_sk as customer_sk, cs.cs_item_sk as item_sk FROM catalog_sales cs JOIN date_dim d2 ON (cs.cs_sold_date_sk = d2.d_date_sk) WHERE d2.d_month_seq >= 1206 and d2.d_month_seq <= 1217 GROUP BY cs.cs_bill_customer_sk, cs.cs_item_sk) csci ON (ssci.customer_sk=csci.customer_sk and ssci.item_sk = csci.item_sk)
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+Reducer 8 <- Map 10 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:-1
+      Stage-1
+         Reducer 5
+         File Output Operator [FS_41]
+            compressed:false
+            Statistics:Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE
+            table:{"input format:":"org.apache.hadoop.mapred.TextInputFormat","output format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Group By Operator [GBY_39]
+            |  aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)"]
+            |  outputColumnNames:["_col0","_col1","_col2"]
+            |  Statistics:Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE
+            |<-Reducer 4 [SIMPLE_EDGE]
+               Reduce Output Operator [RS_38]
+                  sort order:
+                  Statistics:Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE
+                  value expressions:_col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint)
+                  Group By Operator [GBY_37]
+                     aggregations:["sum(_col0)","sum(_col1)","sum(_col2)"]
+                     outputColumnNames:["_col0","_col1","_col2"]
+                     Statistics:Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE
+                     Select Operator [SEL_35]
+                        outputColumnNames:["_col0","_col1","_col2"]
+                        Statistics:Num rows: 4909 Data size: 5493875 Basic stats: COMPLETE Column stats: NONE
+                        Merge Join Operator [MERGEJOIN_52]
+                        |  condition map:[{"":"Outer Join 0 to 1"}]
+                        |  keys:{"0":"_col0 (type: int), _col1 (type: int)","1":"_col0 (type: int), _col1 (type: int)"}
+                        |  outputColumnNames:["_col0","_col2"]
+                        |  Statistics:Num rows: 4909 Data size: 5493875 Basic stats: COMPLETE Column stats: NONE
+                        |<-Reducer 3 [SIMPLE_EDGE]
+                        |  Reduce Output Operator [RS_32]
+                        |     key expressions:_col0 (type: int), _col1 (type: int)
+                        |     Map-reduce partition columns:_col0 (type: int), _col1 (type: int)
+                        |     sort order:++
+                        |     Statistics:Num rows: 4463 Data size: 4994432 Basic stats: COMPLETE Column stats: NONE
+                        |     Select Operator [SEL_15]
+                        |        outputColumnNames:["_col0","_col1"]
+                        |        Statistics:Num rows: 4463 Data size: 4994432 Basic stats: COMPLETE Column stats: NONE
+                        |        Group By Operator [GBY_14]
+                        |        |  keys:KEY._col0 (type: int), KEY._col1 (type: int)
+                        |        |  outputColumnNames:["_col0","_col1"]
+                        |        |  Statistics:Num rows: 4463 Data size: 4994432 Basic stats: COMPLETE Column stats: NONE
+                        |        |<-Reducer 2 [SIMPLE_EDGE]
+                        |           Reduce Output Operator [RS_13]
+                        |              key expressions:_col0 (type: int), _col1 (type: int)
+                        |              Map-reduce partition columns:_col0 (type: int), _col1 (type: int)
+                        |              sort order:++
+                        |              Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                        |              Group By Operator [GBY_12]
+                        |                 keys:_col1 (type: int), _col2 (type: int)
+                        |                 outputColumnNames:["_col0","_col1"]
+                        |                 Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                        |                 Merge Join Operator [MERGEJOIN_50]
+                        |                 |  condition map:[{"":"Inner Join 0 to 1"}]
+                        |                 |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                        |                 |  outputColumnNames:["_col1","_col2"]
+                        |                 |  Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                        |                 |<-Map 1 [SIMPLE_EDGE]
+                        |                 |  Reduce Output Operator [RS_7]
+                        |                 |     key expressions:_col0 (type: int)
+                        |                 |     Map-reduce partition columns:_col0 (type: int)
+                        |                 |     sort order:+
+                        |                 |     Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                 |     value expressions:_col1 (type: int), _col2 (type: int)
+                        |                 |     Select Operator [SEL_2]
+                        |                 |        outputColumnNames:["_col0","_col1","_col2"]
+                        |                 |        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                 |        Filter Operator [FIL_46]
+                        |                 |           predicate:ss_sold_date_sk is not null (type: boolean)
+                        |                 |           Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                 |           TableScan [TS_0]
+                        |                 |              alias:ss
+                        |                 |              Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                        |                 |<-Map 6 [SIMPLE_EDGE]
+                        |                    Reduce Output Operator [RS_9]
+                        |                       key expressions:_col0 (type: int)
+                        |                       Map-reduce partition columns:_col0 (type: int)
+                        |                       sort order:+
+                        |                       Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                        |                       Select Operator [SEL_5]
+                        |                          outputColumnNames:["_col0"]
+                        |                          Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                        |                          Filter Operator [FIL_47]
+                        |                             predicate:(((d_month_seq <= 1217) and d_date_sk is not null) and (d_month_seq >= 1206)) (type: boolean)
+                        |                             Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                        |                             TableScan [TS_3]
+                        |                                alias:d1
+                        |                                Statistics:Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                        |<-Reducer 9 [SIMPLE_EDGE]
+                           Reduce Output Operator [RS_33]
+                              key expressions:_col0 (type: int), _col1 (type: int)
+                              Map-reduce partition columns:_col0 (type: int), _col1 (type: int)
+                              sort order:++
+                              Statistics:Num rows: 4463 Data size: 4994432 Basic stats: COMPLETE Column stats: NONE
+                              Group By Operator [GBY_30]
+                              |  keys:KEY._col0 (type: int), KEY._col1 (type: int)
+                              |  outputColumnNames:["_col0","_col1"]
+                              |  Statistics:Num rows: 4463 Data size: 4994432 Basic stats: COMPLETE Column stats: NONE
+                              |<-Reducer 8 [SIMPLE_EDGE]
+                                 Reduce Output Operator [RS_29]
+                                    key expressions:_col0 (type: int), _col1 (type: int)
+                                    Map-reduce partition columns:_col0 (type: int), _col1 (type: int)
+                                    sort order:++
+                                    Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                                    Group By Operator [GBY_28]
+                                       keys:_col1 (type: int), _col2 (type: int)
+                                       outputColumnNames:["_col0","_col1"]
+                                       Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                                       Merge Join Operator [MERGEJOIN_51]
+                                       |  condition map:[{"":"Inner Join 0 to 1"}]
+                                       |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                                       |  outputColumnNames:["_col1","_col2"]
+                                       |  Statistics:Num rows: 8927 Data size: 9989984 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 10 [SIMPLE_EDGE]
+                                       |  Reduce Output Operator [RS_25]
+                                       |     key expressions:_col0 (type: int)
+                                       |     Map-reduce partition columns:_col0 (type: int)
+                                       |     sort order:+
+                                       |     Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                                       |     Select Operator [SEL_21]
+                                       |        outputColumnNames:["_col0"]
+                                       |        Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                                       |        Filter Operator [FIL_49]
+                                       |           predicate:(((d_month_seq <= 1217) and d_date_sk is not null) and (d_month_seq >= 1206)) (type: boolean)
+                                       |           Statistics:Num rows: 8116 Data size: 9081804 Basic stats: COMPLETE Column stats: NONE
+                                       |           TableScan [TS_19]
+                                       |              alias:d1
+                                       |              Statistics:Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 7 [SIMPLE_EDGE]
+                                          Reduce Output Operator [RS_23]
+                                             key expressions:_col0 (type: int)
+                                             Map-reduce partition columns:_col0 (type: int)
+                                             sort order:+
+                                             Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                             value expressions:_col1 (type: int), _col2 (type: int)
+                                             Select Operator [SEL_18]
+                                                outputColumnNames:["_col0","_col1","_col2"]
+                                                Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                Filter Operator [FIL_48]
+                                                   predicate:cs_sold_date_sk is not null (type: boolean)
+                                                   Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   TableScan [TS_16]
+                                                      alias:cs
+                                                      Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+