patch 4.0
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -21,361 +21,361 @@ index k4(c1,c2,c3,c4),
|
||||
index k5(c1,c2,c3,c4,c5));
|
||||
explain select count(*) from t1;
|
||||
Query Plan
|
||||
===========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
-------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |43045|
|
||||
|1 | TABLE SCAN |t1(k1)|100000 |23944|
|
||||
===========================================
|
||||
==========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |2 |
|
||||
|1 | TABLE SCAN |t1(k1)|1 |2 |
|
||||
==========================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([T_FUN_COUNT(*)]), filter(nil),
|
||||
group(nil), agg_func([T_FUN_COUNT(*)])
|
||||
1 - output([1]), filter(nil),
|
||||
access([t1.c1]), partitions(p0)
|
||||
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
|
||||
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
|
||||
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
|
||||
access(nil), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 = 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t1(k1)|990 |6209|
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 = 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 < 1;
|
||||
Query Plan
|
||||
======================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
--------------------------------------
|
||||
|0 |TABLE SCAN|t1(k1)|10000 |62113|
|
||||
======================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 < 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 > 1;
|
||||
Query Plan
|
||||
======================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
--------------------------------------
|
||||
|0 |TABLE SCAN|t1(k1)|10000 |62113|
|
||||
======================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 > 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 > 1 and c1 < 10;
|
||||
Query Plan
|
||||
======================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
--------------------------------------
|
||||
|0 |TABLE SCAN|t1(k1)|5000 |31098|
|
||||
======================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 > 1], [t1.c1 < 10]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 = 1 and c2 < 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t1(k2)|99 |679 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c2 < 1], [t1.c1 = 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 = 1 and c2 = 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t1(k2)|10 |142 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 = 1], [t1.c2 = 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 = 1 and c2 = 1 and c3 < 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t1(k3)|1 |89 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c3 < 1], [t1.c1 = 1], [t1.c2 = 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select * from t1 where c1 = 1 and c2 = 1 and c3 = 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t1(k3)|1 |89 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t1 |1 |3 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil),
|
||||
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter([t1.c1 = 1], [t1.c2 = 1], [t1.c3 = 1]), rowset=256,
|
||||
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
|
||||
|
||||
explain select count(*) from t2;
|
||||
Query Plan
|
||||
===========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
-------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |52640|
|
||||
|1 | TABLE SCAN |t2(k1)|100000 |33539|
|
||||
===========================================
|
||||
==========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |2 |
|
||||
|1 | TABLE SCAN |t2(k1)|1 |2 |
|
||||
==========================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([T_FUN_COUNT(*)]), filter(nil),
|
||||
group(nil), agg_func([T_FUN_COUNT(*)])
|
||||
1 - output([1]), filter(nil),
|
||||
access([t2.c1]), partitions(p0)
|
||||
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
|
||||
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
|
||||
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
|
||||
access(nil), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 = 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |990 |820 |
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 < 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |10000 |7983|
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 > 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |10000 |7983|
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 > 1 and c1 < 10;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |5000 |4010|
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 = 1 and c2 < 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t2(k2)|99 |675 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 < 1]), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 = 1 and c2 = 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t2(k2)|10 |142 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1]), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 = 1 and c2 = 1 and c3 < 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t2(k3)|1 |89 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c3 < 1], [t2.c2 = 1]), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select * from t2 where c1 = 1 and c2 = 1 and c3 = 1;
|
||||
Query Plan
|
||||
=====================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
-------------------------------------
|
||||
|0 |TABLE SCAN|t2(k3)|1 |89 |
|
||||
=====================================
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t2 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil),
|
||||
access([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1], [t2.c3 = 1]), rowset=256,
|
||||
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
|
||||
|
||||
explain select count(*) from t3;
|
||||
Query Plan
|
||||
===========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST |
|
||||
-------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |52640|
|
||||
|1 | TABLE SCAN |t3(k1)|100000 |33539|
|
||||
===========================================
|
||||
==========================================
|
||||
|ID|OPERATOR |NAME |EST. ROWS|COST|
|
||||
------------------------------------------
|
||||
|0 |SCALAR GROUP BY| |1 |2 |
|
||||
|1 | TABLE SCAN |t3(k1)|1 |2 |
|
||||
==========================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([T_FUN_COUNT(*)]), filter(nil),
|
||||
group(nil), agg_func([T_FUN_COUNT(*)])
|
||||
1 - output([1]), filter(nil),
|
||||
access([t3.c1]), partitions(p0)
|
||||
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
|
||||
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
|
||||
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
|
||||
access(nil), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 = 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |990 |820 |
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 < 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |10000 |7983|
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 > 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |10000 |7983|
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 > 1 and c1 < 10;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |5000 |4010|
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 = 1 and c2 < 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |99 |107 |
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 = 1 and c2 = 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |10 |40 |
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 = 1 and c2 = 1 and c3 < 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |1 |41 |
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 < 1]),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 < 1]), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
explain select * from t3 where c1 = 1 and c2 = 1 and c3 = 1;
|
||||
Query Plan
|
||||
===================================
|
||||
|ID|OPERATOR |NAME|EST. ROWS|COST|
|
||||
-----------------------------------
|
||||
|0 |TABLE SCAN|t3 |1 |41 |
|
||||
|0 |TABLE SCAN|t3 |1 |2 |
|
||||
===================================
|
||||
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 = 1]),
|
||||
access([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 = 1]), rowset=256,
|
||||
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
--disable_query_log
|
||||
set @@session.explicit_defaults_for_timestamp=off;
|
||||
--enable_query_log
|
||||
# owner: guoping.wgp
|
||||
# owner: zhenling.zzg
|
||||
# owner group: SQL1
|
||||
# tags: optimizer
|
||||
# description: leading hint is used to specify table join order, e.g., select /*+ leading(t1, t3, t2) */ ... from t1,t2,t3,t4,t5,t6...
|
||||
@ -33,6 +33,27 @@ create table t1(a int, b int, c int);
|
||||
create table t2(a int, b int, c int);
|
||||
create table t3(a int, b int, c int);
|
||||
|
||||
delimiter //;
|
||||
|
||||
create procedure insert_p_nn1nn2()
|
||||
begin
|
||||
declare i int;
|
||||
insert into nn1 values(null, null, null);
|
||||
insert into nn2 values(null, null, null);
|
||||
set i = 0;
|
||||
while i < 10 do
|
||||
insert into nn1 values(mod(i, 7), mod(i, 6), concat('hello1', mod(i, 3)));
|
||||
insert into nn2 values(mod(i, 5), mod(i, 3), concat('hello1', mod(i, 2)));
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end
|
||||
//
|
||||
|
||||
delimiter ;//
|
||||
|
||||
call insert_p_nn1nn2();
|
||||
sleep 3;
|
||||
|
||||
## set @@session.ob_enable_transformation = 0;
|
||||
# trace result set and plan both
|
||||
--result_format 4
|
||||
@ -295,6 +316,7 @@ where t1.c1 = t2.c1 and
|
||||
t4.d1 = t5.d1 AND
|
||||
t1.c1 + t2.c1 = t4.d1 + t5.d2 ;
|
||||
|
||||
--echo ### 9. https://work.aone.alibaba-inc.com/issue/22041461 leading hint与join order冲突修复 ###
|
||||
explain select /*+leading(t1 (t2 t3))*/* from t1,t3 where t1.a = t3.a and t1.b not in (select b from t2); #失效
|
||||
explain select /*+leading(t2 t3 t1)*/* from t1,t3 where t1.a = t3.a and t1.b not in (select b from t2); #失效
|
||||
explain select /*+leading(t3 t1 t2)*/* from t1,t3 where t1.a = t3.a and t1.b not in (select b from t2); #生效
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
--disable_query_log
|
||||
set @@session.explicit_defaults_for_timestamp=off;
|
||||
--enable_query_log
|
||||
#owner:guoping.wgp
|
||||
#owner:jiangxiu.wt
|
||||
#owner group: sql1
|
||||
# tags: optimizer
|
||||
#this file test default optimizer selectivity
|
||||
@ -64,4 +64,4 @@ explain select * from t3 where c1 > 1 and c1 < 10;
|
||||
explain select * from t3 where c1 = 1 and c2 < 1;
|
||||
explain select * from t3 where c1 = 1 and c2 = 1;
|
||||
explain select * from t3 where c1 = 1 and c2 = 1 and c3 < 1;
|
||||
explain select * from t3 where c1 = 1 and c2 = 1 and c3 = 1;
|
||||
explain select * from t3 where c1 = 1 and c2 = 1 and c3 = 1;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
--disable_query_log
|
||||
set @@session.explicit_defaults_for_timestamp=off;
|
||||
--enable_query_log
|
||||
#owner:guoping.wgp
|
||||
#owner:yibo.tyf
|
||||
#owner group: sql1
|
||||
# tags: optimizer
|
||||
#equal set mainly has two advantages, the first one is to elimiate sort, the other one is to optimize partition_wise_join
|
||||
@ -399,6 +399,7 @@ explain select * from t1 where (t1.a, t1.b) in (select t2.a, t2.b from t2);
|
||||
explain select * from t1 where (t1.a, t1.b) in (select t2.a, t2.b from t2) and (t1.a, t1.b) in (select t3.a, t3.b from t3);
|
||||
explain select * from t1 where (t1.a, t1.b) in (select t2.a, t2.b from t2 where (t2.a, t2.b) in (select t3.a, t3.b from t3));
|
||||
|
||||
##bug https://aone.alibaba-inc.com/issue/14360360?from=ak&spm=a2o8d.projectdomain.0.0.549d2a00jnjFhQ
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3;
|
||||
--enable_warnings
|
||||
@ -528,6 +529,7 @@ explain select * from (select 1 a except select a from t1 except select b from t
|
||||
explain select * from (select a from t1 except select a from t2 except select 1 a) as t3, t1 as t4 where t3.a = t4.a;
|
||||
explain select * from (select t2.a from t1, t2 where t1.a = t2.a except select a from t1 as t3) as t4, t2 as t5 where t4.a = t5.a;
|
||||
|
||||
###https://aone.alibaba-inc.com/project/81079/issue/15439492
|
||||
explain select * from (select 1 c1, 1 c2) t2 inner join t1 on t2.c1 = t1.a;
|
||||
explain select * from (select 1 c1, 1 c2) t2 left join t1 on t2.c1 = t1.a;
|
||||
explain select * from (select 1 c1, 1 c2) t2 right join t1 on t2.c1 = t1.a;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
--disable_query_log
|
||||
set @@session.explicit_defaults_for_timestamp=off;
|
||||
--enable_query_log
|
||||
#owner: guoping.wgp
|
||||
#owner: zhenling.zzg
|
||||
#owner group: sql1
|
||||
# tags: optimizer
|
||||
|
||||
@ -53,9 +53,9 @@ explain select /*+index(test_table index_1)*/ * from test_table where age = 22;
|
||||
select count(*) from test_table where name = 'name22';
|
||||
explain select /*+index(test_table index_2)*/ * from test_table where name = 'name22';
|
||||
|
||||
--source mysql_test/include/majorfreeze.inc
|
||||
--source mysql_test/include/wait_daily_merge.inc
|
||||
--source mysql_test/include/check_stat.inc
|
||||
--source mysql_test/include/minorfreeze.inc
|
||||
--source mysql_test/include/wait_minor_merge.inc
|
||||
call dbms_stats.gather_table_stats('TEST', 'test_table');
|
||||
|
||||
# case 2: all data in sstable, not memtable data
|
||||
--echo case 2: all data in sstable, not memtable data
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
--source mysql_test/include/explain_init.inc
|
||||
--disable_query_log
|
||||
#set @@session.explicit_defaults_for_timestamp=off;
|
||||
--enable_query_log
|
||||
@ -571,3 +572,4 @@ SELECT col_bigint, col_bigint_signed, col_bigint_unsigned, col_char_20, col_deci
|
||||
ORDER BY col_bigint, col_bigint_signed, col_bigint_unsigned, col_char_20, col_decimal_20_0, col_decimal_20_0_signed, col_decimal_20_0_unsigned, col_timestamp_6, pk;
|
||||
|
||||
drop database union_sort_opt_db;
|
||||
--source mysql_test/include/explain_end.inc
|
||||
|
||||
Reference in New Issue
Block a user