patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -11,35 +11,33 @@ select /*+ USE_PX parallel(3) */* from
(select c1,count(c2) c2 from t1 group by c1)c) a join
(select c1,count(*) c2 from t2 group by c1)b on a.c1=b.c1 ;
Query Plan
=============================================
|ID|OPERATOR |NAME |
---------------------------------------------
|0 |PX COORDINATOR | |
|1 | EXCHANGE OUT DISTR |:EX10001|
|2 | MERGE JOIN | |
|3 | EXCHANGE IN MERGE SORT DISTR| |
|4 | EXCHANGE OUT DISTR (PKEY) |:EX10000|
|5 | PX BLOCK ITERATOR | |
|6 | TABLE SCAN |t1 |
|7 | SORT | |
|8 | PX PARTITION ITERATOR | |
|9 | TABLE SCAN |t2 |
=============================================
===========================================
|ID|OPERATOR |NAME |
-------------------------------------------
|0 |PX COORDINATOR | |
|1 | EXCHANGE OUT DISTR |:EX10001|
|2 | HASH JOIN | |
|3 | PX PARTITION ITERATOR | |
|4 | TABLE SCAN |t1 |
|5 | EXCHANGE IN DISTR | |
|6 | EXCHANGE OUT DISTR (PKEY)|:EX10000|
|7 | PX BLOCK ITERATOR | |
|8 | TABLE SCAN |t2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [1], [t2.c1], [1]), filter(nil)
1 - output([t1.c1], [t2.c1], [1], [1]), filter(nil), dop=3
2 - output([t1.c1], [t2.c1], [1], [1]), filter(nil),
0 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=256, dop=3
2 - output([t1.c1], [t2.c1]), filter(nil), rowset=256,
equal_conds([t1.c1 = t2.c1]), other_conds(nil)
3 - output([t1.c1]), filter(nil), sort_keys([t1.c1, ASC]), Local Order
4 - (#keys=1, [t1.c1]), output([t1.c1]), filter(nil), dop=3
5 - output([t1.c1]), filter(nil)
6 - output([t1.c1]), filter(nil),
3 - output([t1.c1]), filter(nil), rowset=256
4 - output([t1.c1]), filter(nil), rowset=256,
access([t1.c1]), partitions(p[0-9])
7 - output([t2.c1]), filter(nil), sort_keys([t2.c1, ASC]), local merge sort
8 - output([t2.c1]), filter(nil)
9 - output([t2.c1]), filter(nil),
5 - output([t2.c1]), filter(nil), rowset=256
6 - (#keys=1, [t2.c1]), output([t2.c1]), filter(nil), rowset=256, dop=3
7 - output([t2.c1]), filter(nil), rowset=256
8 - output([t2.c1]), filter(nil), rowset=256,
access([t2.c1]), partitions(p[0-5])
select /*+ USE_PX parallel(3) */* from
@ -60,45 +58,46 @@ c1 c2 c1 c2
explain basic
select a.c2,count(*) from (select /*+ USE_PX parallel(3) PQ_DISTRIBUTE(b HASH HASH) */a.c1,a.c2,b.c1 c3,b.c2 c4 from t1 a join t2 b on a.c1=b.c1)a group by a.c2;
Query Plan
================================================
|ID|OPERATOR |NAME |
------------------------------------------------
|0 |PX COORDINATOR | |
|1 | EXCHANGE OUT DISTR |:EX10003|
|2 | HASH GROUP BY | |
|3 | EXCHANGE IN DISTR | |
|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|
|5 | MERGE JOIN | |
|6 | EXCHANGE IN MERGE SORT DISTR| |
|7 | EXCHANGE OUT DISTR (HASH) |:EX10000|
|8 | PX BLOCK ITERATOR | |
|9 | TABLE SCAN |a |
|10| EXCHANGE IN MERGE SORT DISTR| |
|11| EXCHANGE OUT DISTR (HASH) |:EX10001|
|12| PX BLOCK ITERATOR | |
|13| TABLE SCAN |b |
================================================
==================================================
|ID|OPERATOR |NAME |
--------------------------------------------------
|0 |PX COORDINATOR | |
|1 | EXCHANGE OUT DISTR |:EX10002|
|2 | HASH GROUP BY | |
|3 | EXCHANGE IN DISTR | |
|4 | EXCHANGE OUT DISTR (HASH) |:EX10001|
|5 | HASH GROUP BY | |
|6 | HASH JOIN | |
|7 | PART JOIN FILTER CREATE |:BF0000 |
|8 | EXCHANGE IN DISTR | |
|9 | EXCHANGE OUT DISTR (PKEY) |:EX10000|
|10| PX BLOCK ITERATOR | |
|11| TABLE SCAN |b |
|12| PX PARTITION HASH JOIN-FILTER|:BF0000 |
|13| TABLE SCAN |a |
==================================================
Outputs & filters:
-------------------------------------
0 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil)
1 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), dop=3
2 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil),
0 - output([INTERNAL_FUNCTION(a.c2, T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(a.c2, T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256, dop=3
2 - output([a.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
group([a.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
3 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
4 - (#keys=1, [a.c2]), output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=3
5 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
group([a.c2]), agg_func([T_FUN_COUNT(*)])
3 - output([a.c2]), filter(nil)
4 - (#keys=1, [a.c2]), output([a.c2]), filter(nil), dop=3
5 - output([a.c2]), filter(nil),
6 - output([a.c2]), filter(nil), rowset=256,
equal_conds([a.c1 = b.c1]), other_conds(nil)
6 - output([a.c1], [a.c2]), filter(nil), sort_keys([a.c1, ASC]), Local Order
7 - (#keys=1, [a.c1]), output([a.c1], [a.c2]), filter(nil), dop=3
8 - output([a.c1], [a.c2]), filter(nil)
9 - output([a.c1], [a.c2]), filter(nil),
access([a.c1], [a.c2]), partitions(p[0-9])
10 - output([b.c1]), filter(nil), sort_keys([b.c1, ASC]), Local Order
11 - (#keys=1, [b.c1]), output([b.c1]), filter(nil), dop=3
12 - output([b.c1]), filter(nil)
13 - output([b.c1]), filter(nil),
7 - output([b.c1]), filter(nil), rowset=256
8 - output([b.c1]), filter(nil), rowset=256
9 - (#keys=1, [b.c1]), output([b.c1]), filter(nil), rowset=256, dop=3
10 - output([b.c1]), filter(nil), rowset=256
11 - output([b.c1]), filter(nil), rowset=256,
access([b.c1]), partitions(p[0-5])
12 - output([a.c1], [a.c2]), filter(nil), rowset=256
13 - output([a.c1], [a.c2], [PARTITION_ID]), filter(nil), rowset=256,
access([a.c1], [a.c2]), partitions(p[0-9])
select a.c2,count(*) from (select /*+ USE_PX parallel(3) PQ_DISTRIBUTE(b HASH HASH) */a.c1,a.c2,b.c1 c3,b.c2 c4 from t1 a join t2 b on a.c1=b.c1)a group by a.c2;
c2 count(*)

View File

@ -3,225 +3,162 @@ create table t1 (c1 int, c2 int, c3 int);
create table t2 (c1 int, c2 int, c3 int);
explain select /*+ use_px parallel(2) use_hash(c d) */ * from (select a.c2, b.c3 from (select /*+ use_hash(a, b) */ c1, c2, count(*) c3 from t1 group by 1, 2) a, (select c1, c2, count(*) c3 from t1 group by 1, 2) b where a.c1 = b.c1) c, (select c1, c2, count(*) c3 from t1 group by 1, 2) d where c.c2 = d.c2;
Query Plan
====================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
--------------------------------------------------------------------
|0 |PX COORDINATOR | |96059602 |90225641|
|1 | EXCHANGE OUT DISTR |:EX10005|96059602 |58400112|
|2 | HASH JOIN | |96059602 |58400112|
|3 | EXCHANGE IN DISTR | |10001 |169529 |
|4 | EXCHANGE OUT DISTR (BROADCAST) |:EX10001|10001 |168583 |
|5 | SUBPLAN SCAN |b |10001 |168583 |
|6 | HASH GROUP BY | |10001 |167202 |
|7 | EXCHANGE IN DISTR | |10001 |116107 |
|8 | EXCHANGE OUT DISTR (HASH) |:EX10000|10001 |115161 |
|9 | HASH GROUP BY | |10001 |115161 |
|10| PX BLOCK ITERATOR | |100000 |64066 |
|11| TABLE SCAN |t1 |100000 |64066 |
|12| HASH JOIN | |980101 |924869 |
|13| EXCHANGE IN DISTR | |10001 |158931 |
|14| EXCHANGE OUT DISTR (BROADCAST)|:EX10003|10001 |157984 |
|15| SUBPLAN SCAN |a |10001 |157984 |
|16| HASH GROUP BY | |10001 |156604 |
|17| EXCHANGE IN DISTR | |10001 |110808 |
|18| EXCHANGE OUT DISTR (HASH) |:EX10002|10001 |109862 |
|19| HASH GROUP BY | |10001 |109862 |
|20| PX BLOCK ITERATOR | |100000 |64066 |
|21| TABLE SCAN |t1 |100000 |64066 |
|22| SUBPLAN SCAN |d |10001 |168583 |
|23| HASH GROUP BY | |10001 |167202 |
|24| EXCHANGE IN DISTR | |10001 |116107 |
|25| EXCHANGE OUT DISTR (HASH) |:EX10004|10001 |115161 |
|26| HASH GROUP BY | |10001 |115161 |
|27| PX BLOCK ITERATOR | |100000 |64066 |
|28| TABLE SCAN |t1 |100000 |64066 |
====================================================================
=====================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
---------------------------------------------------------------------
|0 |TEMP TABLE TRANSFORMATION | |1 |5 |
|1 | PX COORDINATOR | |1 |4 |
|2 | EXCHANGE OUT DISTR |:EX10001 |1 |4 |
|3 | TEMP TABLE INSERT |TEMP1 |1 |3 |
|4 | HASH GROUP BY | |1 |3 |
|5 | EXCHANGE IN DISTR | |2 |3 |
|6 | EXCHANGE OUT DISTR (HASH) |:EX10000 |2 |3 |
|7 | HASH GROUP BY | |2 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| PX COORDINATOR | |1 |2 |
|11| EXCHANGE OUT DISTR |:EX20002 |1 |2 |
|12| SHARED HASH JOIN | |1 |1 |
|13| EXCHANGE IN DISTR | |1 |1 |
|14| EXCHANGE OUT DISTR (BC2HOST) |:EX20001 |1 |1 |
|15| SHARED HASH JOIN | |1 |1 |
|16| EXCHANGE IN DISTR | |1 |1 |
|17| EXCHANGE OUT DISTR (BC2HOST)|:EX20000 |1 |1 |
|18| TEMP TABLE ACCESS |VIEW2(TEMP1)|1 |1 |
|19| TEMP TABLE ACCESS |VIEW3(TEMP1)|1 |1 |
|20| TEMP TABLE ACCESS |VIEW1(TEMP1)|1 |1 |
=====================================================================
Outputs & filters:
-------------------------------------
0 - output([a.c2], [b.c3], [d.c1], [d.c2], [d.c3]), filter(nil)
1 - output([a.c2], [b.c3], [d.c1], [d.c2], [d.c3]), filter(nil), dop=2
2 - output([a.c2], [b.c3], [d.c1], [d.c2], [d.c3]), filter(nil),
equal_conds([a.c1 = b.c1]), other_conds(nil)
3 - output([b.c1], [b.c3]), filter(nil)
4 - output([b.c1], [b.c3]), filter(nil), dop=2
5 - output([b.c1], [b.c3]), filter(nil),
access([b.c1], [b.c3])
6 - output([t1.c1], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil),
0 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
1 - output(nil), filter(nil), rowset=256
2 - output(nil), filter(nil), rowset=256, dop=2
3 - output(nil), filter(nil), rowset=256
4 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
7 - output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil)
8 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil), dop=2
9 - output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil),
5 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
6 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
7 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)])
10 - output([t1.c1], [t1.c2]), filter(nil)
11 - output([t1.c1], [t1.c2]), filter(nil),
access([t1.c1], [t1.c2]), partitions(p0)
12 - output([a.c2], [d.c1], [d.c2], [d.c3], [a.c1]), filter(nil),
equal_conds([a.c2 = d.c2]), other_conds(nil)
13 - output([a.c1], [a.c2]), filter(nil)
14 - output([a.c1], [a.c2]), filter(nil), dop=2
15 - output([a.c1], [a.c2]), filter(nil),
access([a.c1], [a.c2])
16 - output([t1.c1], [t1.c2]), filter(nil),
group([t1.c1], [t1.c2]), agg_func(nil)
17 - output([t1.c1], [t1.c2]), filter(nil)
18 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2]), filter(nil), dop=2
19 - output([t1.c1], [t1.c2]), filter(nil),
group([t1.c1], [t1.c2]), agg_func(nil)
20 - output([t1.c1], [t1.c2]), filter(nil)
21 - output([t1.c1], [t1.c2]), filter(nil),
access([t1.c1], [t1.c2]), partitions(p0)
22 - output([d.c2], [d.c1], [d.c3]), filter(nil),
access([d.c2], [d.c1], [d.c3])
23 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
24 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil)
25 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), dop=2
26 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)])
27 - output([t1.c1], [t1.c2]), filter(nil)
28 - output([t1.c1], [t1.c2]), filter(nil),
8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
access([t1.c1], [t1.c2]), partitions(p0)
10 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
11 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
12 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256,
equal_conds([VIEW2.t1.c2 = VIEW1.t1.c2]), other_conds(nil)
13 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
14 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
15 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256,
equal_conds([VIEW2.t1.c1 = VIEW3.t1.c1]), other_conds(nil)
16 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256
17 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256, dop=2
18 - output([VIEW2.t1.c1], [VIEW2.t1.c2]), filter(nil), rowset=256,
access([VIEW2.t1.c1], [VIEW2.t1.c2])
19 - output([VIEW3.t1.c1], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256,
access([VIEW3.t1.c1], [VIEW3.T_FUN_COUNT(*)])
20 - output([VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256,
access([VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)])
explain select /*+ use_px parallel(2) use_merge(a b) */ b.c2, sum(a.c3) from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1 group by 1;
Query Plan
===============================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
-------------------------------------------------------------------------------
|0 |PX COORDINATOR | |101 |744726|
|1 | EXCHANGE OUT DISTR |:EX10005|101 |744696|
|2 | MERGE GROUP BY | |101 |744696|
|3 | EXCHANGE IN MERGE SORT DISTR | |101 |742003|
|4 | EXCHANGE OUT DISTR (HASH) |:EX10004|101 |741972|
|5 | MERGE GROUP BY | |101 |741972|
|6 | SORT | |9802 |739279|
|7 | MERGE JOIN | |9802 |712834|
|8 | MATERIAL | |101 |355664|
|9 | EXCHANGE IN MERGE SORT DISTR | |101 |355600|
|10| EXCHANGE OUT DISTR (BROADCAST) |:EX10002|101 |355583|
|11| MATERIAL | |101 |355583|
|12| SUBPLAN SCAN |VIEW1 |101 |355519|
|13| MERGE GROUP BY | |101 |355505|
|14| EXCHANGE IN MERGE SORT DISTR | |101 |352758|
|15| EXCHANGE OUT DISTR (HASH) |:EX10001|101 |352748|
|16| MATERIAL | |101 |352748|
|17| MERGE GROUP BY | |101 |352711|
|18| SUBPLAN SCAN |a |10001 |349964|
|19| MERGE GROUP BY | |10001 |348584|
|20| EXCHANGE IN MERGE SORT DISTR| |10001 |312738|
|21| EXCHANGE OUT DISTR (HASH) |:EX10000|10001 |311791|
|22| MERGE GROUP BY | |10001 |311791|
|23| SORT | |100000 |275945|
|24| PX BLOCK ITERATOR | |100000 |64066 |
|25| TABLE SCAN |t1 |100000 |64066 |
|26| SUBPLAN SCAN |VIEW2 |10001 |349964|
|27| MERGE GROUP BY | |10001 |348584|
|28| EXCHANGE IN MERGE SORT DISTR | |10001 |312738|
|29| EXCHANGE OUT DISTR (HASH) |:EX10003|10001 |311791|
|30| MERGE GROUP BY | |10001 |311791|
|31| SORT | |100000 |275945|
|32| PX BLOCK ITERATOR | |100000 |64066 |
|33| TABLE SCAN |b |100000 |64066 |
===============================================================================
==================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10003|1 |5 |
|2 | HASH GROUP BY | |1 |5 |
|3 | EXCHANGE IN DISTR | |2 |5 |
|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|2 |4 |
|5 | HASH GROUP BY | |2 |4 |
|6 | SUBPLAN SCAN |VIEW1 |1 |3 |
|7 | MERGE GROUP BY | |1 |3 |
|8 | SORT | |1 |3 |
|9 | MERGE JOIN | |1 |3 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
|15| SORT | |1 |2 |
|16| EXCHANGE IN DISTR | |1 |2 |
|17| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|18| PX BLOCK ITERATOR | |1 |1 |
|19| TABLE SCAN |t1 |1 |1 |
==================================================================
Outputs & filters:
-------------------------------------
0 - output([VIEW2.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0))))]), filter(nil)
1 - output([VIEW2.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0))))]), filter(nil), dop=2
2 - output([VIEW2.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0))))]), filter(nil),
group([VIEW2.b.c2]), agg_func([T_FUN_SUM(T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0))))])
3 - output([VIEW2.b.c2], [T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)))]), filter(nil), sort_keys([VIEW2.b.c2, ASC])
4 - (#keys=1, [VIEW2.b.c2]), output([VIEW2.b.c2], [T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)))]), filter(nil), dop=2
5 - output([VIEW2.b.c2], [T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)))]), filter(nil),
group([VIEW2.b.c2]), agg_func([T_FUN_SUM(VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)))])
6 - output([VIEW2.b.c2], [VIEW1.T_FUN_SUM(a.c3) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0))]), filter(nil), sort_keys([VIEW2.b.c2, ASC])
7 - output([VIEW2.b.c2], [VIEW1.T_FUN_SUM(a.c3)], [VIEW2.T_FUN_COUNT(*)]), filter(nil),
equal_conds([VIEW1.a.c1 = VIEW2.b.c1]), other_conds(nil)
8 - output([VIEW1.T_FUN_SUM(a.c3)], [VIEW1.a.c1]), filter(nil)
9 - output([VIEW1.T_FUN_SUM(a.c3)], [VIEW1.a.c1]), filter(nil), sort_keys([VIEW1.a.c1, ASC])
10 - output([VIEW1.T_FUN_SUM(a.c3)], [VIEW1.a.c1]), filter(nil), dop=2
11 - output([VIEW1.T_FUN_SUM(a.c3)], [VIEW1.a.c1]), filter(nil)
12 - output([VIEW1.a.c1], [VIEW1.T_FUN_SUM(a.c3)]), filter(nil),
access([VIEW1.a.c1], [VIEW1.T_FUN_SUM(a.c3)])
13 - output([a.c1], [T_FUN_SUM(T_FUN_SUM(a.c3))]), filter(nil),
group([a.c1]), agg_func([T_FUN_SUM(T_FUN_SUM(a.c3))])
14 - output([a.c1], [T_FUN_SUM(a.c3)]), filter(nil), sort_keys([a.c1, ASC])
15 - (#keys=1, [a.c1]), output([a.c1], [T_FUN_SUM(a.c3)]), filter(nil), dop=2
16 - output([a.c1], [T_FUN_SUM(a.c3)]), filter(nil)
17 - output([a.c1], [T_FUN_SUM(a.c3)]), filter(nil),
group([a.c1]), agg_func([T_FUN_SUM(a.c3)])
18 - output([a.c1], [a.c3]), filter(nil),
access([a.c1], [a.c3])
19 - output([t1.c1], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
20 - output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil), sort_keys([t1.c1, ASC], [t1.c2, ASC])
21 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil), dop=2
22 - output([t1.c1], [T_FUN_COUNT(*)], [t1.c2]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)])
23 - output([t1.c1], [t1.c2]), filter(nil), sort_keys([t1.c1, ASC], [t1.c2, ASC])
24 - output([t1.c1], [t1.c2]), filter(nil)
25 - output([t1.c1], [t1.c2]), filter(nil),
0 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256, dop=2
2 - output([VIEW1.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))]), filter(nil), rowset=256,
group([VIEW1.b.c2]), agg_func([T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))])
3 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256
4 - (#keys=1, [VIEW1.b.c2]), output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256, dop=2
5 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256,
group([VIEW1.b.c2]), agg_func([T_FUN_SUM(VIEW1.a.c3)])
6 - output([VIEW1.b.c2], [VIEW1.a.c3]), filter(nil), rowset=256,
access([VIEW1.b.c2], [VIEW1.a.c3])
7 - output([b.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)])
8 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC])
9 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256,
equal_conds([t1.c1 = b.c1]), other_conds(nil)
10 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256
12 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256,
access([b.__pk_increment], [b.c1], [b.c2]), partitions(p0)
15 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC])
16 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
17 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2
18 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
19 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
access([t1.c1], [t1.c2]), partitions(p0)
26 - output([VIEW2.b.c1], [VIEW2.b.c2], [VIEW2.T_FUN_COUNT(*)]), filter(nil),
access([VIEW2.b.c1], [VIEW2.b.c2], [VIEW2.T_FUN_COUNT(*)])
27 - output([b.c1], [b.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil),
group([b.c1], [b.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
28 - output([b.c1], [b.c2], [T_FUN_COUNT(*)]), filter(nil), sort_keys([b.c1, ASC], [b.c2, ASC])
29 - (#keys=2, [b.c1], [b.c2]), output([b.c1], [b.c2], [T_FUN_COUNT(*)]), filter(nil), dop=2
30 - output([b.c1], [b.c2], [T_FUN_COUNT(*)]), filter(nil),
group([b.c1], [b.c2]), agg_func([T_FUN_COUNT(*)])
31 - output([b.c1], [b.c2]), filter(nil), sort_keys([b.c1, ASC], [b.c2, ASC])
32 - output([b.c1], [b.c2]), filter(nil)
33 - output([b.c1], [b.c2]), filter(nil),
access([b.c1], [b.c2]), partitions(p0)
explain select /*+ use_px parallel(2) use_merge(a b) */ * from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1;
Query Plan
====================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
--------------------------------------------------------------------
|0 |PX COORDINATOR | |9801001 |9264343|
|1 | EXCHANGE OUT DISTR |:EX10002|9801001 |6481053|
|2 | MERGE JOIN | |9801001 |6481053|
|3 | EXCHANGE IN MERGE SORT DISTR | |10001 |356896 |
|4 | EXCHANGE OUT DISTR (BROADCAST) |:EX10001|10001 |355477 |
|5 | MATERIAL | |10001 |355477 |
|6 | SUBPLAN SCAN |a |10001 |349964 |
|7 | MERGE GROUP BY | |10001 |348584 |
|8 | EXCHANGE IN MERGE SORT DISTR| |10001 |312738 |
|9 | EXCHANGE OUT DISTR (HASH) |:EX10000|10001 |311791 |
|10| MERGE GROUP BY | |10001 |311791 |
|11| SORT | |100000 |275945 |
|12| PX BLOCK ITERATOR | |100000 |64066 |
|13| TABLE SCAN |t1 |100000 |64066 |
|14| SORT | |100000 |296180 |
|15| PX BLOCK ITERATOR | |100000 |66272 |
|16| TABLE SCAN |b |100000 |66272 |
====================================================================
=============================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10002|1 |4 |
|2 | MERGE GROUP BY | |1 |4 |
|3 | SORT | |1 |4 |
|4 | MERGE JOIN | |1 |4 |
|5 | SORT | |1 |2 |
|6 | EXCHANGE IN DISTR | |1 |2 |
|7 | EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
=============================================================
Outputs & filters:
-------------------------------------
0 - output([a.c1], [a.c2], [a.c3], [b.c1], [b.c2], [b.c3]), filter(nil)
1 - output([a.c1], [a.c2], [a.c3], [b.c1], [b.c2], [b.c3]), filter(nil), dop=2
2 - output([a.c1], [a.c2], [a.c3], [b.c1], [b.c2], [b.c3]), filter(nil),
equal_conds([a.c1 = b.c1]), other_conds(nil)
3 - output([a.c1], [a.c2], [a.c3]), filter(nil), sort_keys([a.c1, ASC])
4 - output([a.c1], [a.c2], [a.c3]), filter(nil), dop=2
5 - output([a.c1], [a.c2], [a.c3]), filter(nil)
6 - output([a.c1], [a.c2], [a.c3]), filter(nil),
access([a.c1], [a.c2], [a.c3])
7 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
8 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), sort_keys([t1.c1, ASC], [t1.c2, ASC])
9 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), dop=2
10 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil),
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)])
11 - output([t1.c1], [t1.c2]), filter(nil), sort_keys([t1.c1, ASC], [t1.c2, ASC])
12 - output([t1.c1], [t1.c2]), filter(nil)
13 - output([t1.c1], [t1.c2]), filter(nil),
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256, dop=2
2 - output([t1.c2], [T_FUN_COUNT(*)], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)])
3 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC])
4 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
equal_conds([t1.c1 = b.c1]), other_conds(nil)
5 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC])
6 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
7 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2
8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
access([t1.c1], [t1.c2]), partitions(p0)
14 - output([b.c1], [b.c2], [b.c3]), filter(nil), sort_keys([b.c1, ASC])
15 - output([b.c1], [b.c2], [b.c3]), filter(nil)
16 - output([b.c1], [b.c2], [b.c3]), filter(nil),
access([b.c1], [b.c2], [b.c3]), partitions(p0)
10 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
12 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
access([b.__pk_increment], [b.c1], [b.c2], [b.c3]), partitions(p0)

View File

@ -7,117 +7,117 @@ create table t1 (c1 int(11) not null, c2 int(11) not null, c3 int(11) not null,
explain select * from t1;
Query Plan
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
------------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR |:EX10000|400000 |256226|
|2 | PX PARTITION ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
======================================================
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=1
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
explain select /*+use_px*/ * from t1;
Query Plan
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
------------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR |:EX10000|400000 |256226|
|2 | PX PARTITION ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
======================================================
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=1
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
explain select /*+use_px parallel(15)*/ * from t1;
Query Plan
==================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
--------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR|:EX10000|400000 |256226|
|2 | PX BLOCK ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
==================================================
================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------
|0 |PX COORDINATOR | |1 |1 |
|1 | EXCHANGE OUT DISTR|:EX10000|1 |1 |
|2 | PX BLOCK ITERATOR| |1 |1 |
|3 | TABLE SCAN |t1 |1 |1 |
================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=15
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=15
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
explain select /*+no_use_px */ * from t1;
Query Plan
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
------------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR |:EX10000|400000 |256226|
|2 | PX PARTITION ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
======================================================
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=1
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
explain select /*+no_use_px use_px*/ * from t1;
Query Plan
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
------------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR |:EX10000|400000 |256226|
|2 | PX PARTITION ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
======================================================
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=1
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
explain select /*+use_px no_use_px */ * from t1;
Query Plan
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
------------------------------------------------------
|0 |PX COORDINATOR | |400000 |313022|
|1 | EXCHANGE OUT DISTR |:EX10000|400000 |256226|
|2 | PX PARTITION ITERATOR| |400000 |256226|
|3 | TABLE SCAN |t1 |400000 |256226|
======================================================
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil)
1 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil), dop=1
2 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil)
3 - output([t1.c2], [t1.c1], [t1.c3]), filter(nil),
access([t1.c2], [t1.c1], [t1.c3]), partitions(p[0-3])
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
drop table if exists t7;

File diff suppressed because it is too large Load Diff

View File

@ -73,29 +73,29 @@ Query Plan
=======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------
|0 |PX COORDINATOR MERGE SORT | |12 |145 |
|1 | EXCHANGE OUT DISTR |:EX10000|12 |140 |
|2 | SORT | |12 |140 |
|3 | PX PARTITION ITERATOR | |12 |113 |
|4 | MERGE JOIN | |12 |113 |
|5 | TABLE SCAN |score |24 |41 |
|6 | SORT | |12 |60 |
|7 | TABLE SCAN |stu |12 |39 |
|0 |PX COORDINATOR MERGE SORT | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | SORT | |1 |11 |
|3 | PX PARTITION ITERATOR | |1 |11 |
|4 | MERGE JOIN | |1 |11 |
|5 | TABLE SCAN |score |1 |6 |
|6 | SORT | |1 |6 |
|7 | TABLE SCAN |stu |1 |6 |
=======================================================
Outputs & filters:
-------------------------------------
0 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil), sort_keys([score.sid, ASC])
1 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil), dop=2
2 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil), sort_keys([score.sid, ASC]), local merge sort
3 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil)
4 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil),
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, sort_keys([score.sid, ASC])
1 - output([score.sid], [INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
2 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([score.sid, ASC]), local merge sort
3 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
4 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
equal_conds([stu.sid = score.sid]), other_conds(nil)
5 - output([score.sid], [score.subject], [score.score]), filter(nil),
5 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
6 - output([stu.sid], [stu.name], [stu.cls]), filter(nil), sort_keys([stu.sid, ASC])
7 - output([stu.sid], [stu.name], [stu.cls]), filter(nil),
access([stu.sid], [stu.name], [stu.cls]), partitions(p[0-5])
6 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([stu.sid, ASC])
7 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256,
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid order by score.sid;
sid name cls sid subject score

View File

@ -73,33 +73,33 @@ Query Plan
================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------------------
|0 |PX COORDINATOR | |15 |106 |
|1 | EXCHANGE OUT DISTR |:EX10001|15 |100 |
|2 | NESTED-LOOP JOIN | |15 |100 |
|3 | PX BLOCK ITERATOR | |24 |41 |
|4 | TABLE SCAN |score |24 |41 |
|5 | MATERIAL | |2 |42 |
|6 | EXCHANGE IN DISTR | |2 |41 |
|7 | EXCHANGE OUT DISTR (BROADCAST)|:EX10000|2 |41 |
|8 | PX BLOCK ITERATOR | |2 |41 |
|9 | TABLE SCAN |stu |2 |41 |
|0 |PX COORDINATOR | |0 |11 |
|1 | EXCHANGE OUT DISTR |:EX10001|0 |11 |
|2 | NESTED-LOOP JOIN | |0 |11 |
|3 | PX BLOCK ITERATOR | |1 |6 |
|4 | TABLE SCAN |score |1 |6 |
|5 | MATERIAL | |1 |6 |
|6 | EXCHANGE IN DISTR | |1 |6 |
|7 | EXCHANGE OUT DISTR (BROADCAST)|:EX10000|1 |6 |
|8 | PX BLOCK ITERATOR | |1 |6 |
|9 | TABLE SCAN |stu |1 |6 |
================================================================
Outputs & filters:
-------------------------------------
0 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil)
1 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil), dop=2
2 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil),
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
2 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
conds([stu.sid != score.sid]), nl_params_(nil)
3 - output([score.sid], [score.subject], [score.score]), filter(nil)
4 - output([score.sid], [score.subject], [score.score]), filter(nil),
3 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
5 - output([stu.sid], [stu.name], [stu.cls]), filter(nil)
6 - output([stu.sid], [stu.name], [stu.cls]), filter(nil)
7 - output([stu.sid], [stu.name], [stu.cls]), filter(nil), dop=2
8 - output([stu.sid], [stu.name], [stu.cls]), filter(nil)
9 - output([stu.sid], [stu.name], [stu.cls]), filter([stu.sid < 12]),
access([stu.sid], [stu.name], [stu.cls]), partitions(p[0-5])
5 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
6 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
7 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, dop=2
8 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256
9 - output([stu.cls], [stu.sid], [stu.name]), filter([stu.sid < 12]), rowset=256,
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid != score.sid and stu.sid < 12;
sid name cls sid subject score
@ -131,34 +131,34 @@ sid name cls sid subject score
11 a1 1 64 MA 87
explain select /*+ USE_PX parallel(2) */ * from score, teacher where teacher.subject = score.subject and teacher.tid = 1;
Query Plan
===============================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
---------------------------------------------------------------
|0 |PX COORDINATOR | |1 |109 |
|1 | EXCHANGE OUT DISTR |:EX10001|1 |109 |
|2 | NESTED-LOOP JOIN | |1 |109 |
|3 | EXCHANGE IN DISTR | |1 |53 |
|4 | EXCHANGE OUT DISTR (BROADCAST)|:EX10000|1 |53 |
|5 | PX BLOCK ITERATOR | |1 |53 |
|6 | TABLE GET |teacher |1 |53 |
|7 | PX BLOCK ITERATOR | |24 |41 |
|8 | TABLE SCAN |score |24 |41 |
===============================================================
=============================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------------
|0 |PX COORDINATOR | |1 |10 |
|1 | EXCHANGE OUT DISTR |:EX10001|1 |9 |
|2 | SHARED HASH JOIN | |1 |8 |
|3 | EXCHANGE IN DISTR | |1 |6 |
|4 | EXCHANGE OUT DISTR (BC2HOST)|:EX10000|1 |6 |
|5 | PX BLOCK ITERATOR | |1 |6 |
|6 | TABLE SCAN |score |1 |6 |
|7 | PX BLOCK ITERATOR | |1 |2 |
|8 | TABLE GET |teacher |1 |2 |
=============================================================
Outputs & filters:
-------------------------------------
0 - output([score.sid], [score.subject], [score.score], [teacher.tid], [teacher.name], [teacher.subject]), filter(nil)
1 - output([score.sid], [score.subject], [score.score], [teacher.tid], [teacher.name], [teacher.subject]), filter(nil), dop=2
2 - output([score.sid], [score.subject], [score.score], [teacher.tid], [teacher.name], [teacher.subject]), filter(nil),
conds([teacher.subject = score.subject]), nl_params_(nil)
3 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil)
4 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), dop=2
5 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil)
6 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil),
access([teacher.tid], [teacher.subject], [teacher.name]), partitions(p1)
7 - output([score.sid], [score.subject], [score.score]), filter(nil)
8 - output([score.sid], [score.subject], [score.score]), filter(nil),
0 - output([INTERNAL_FUNCTION(score.sid, score.subject, score.score, teacher.tid, teacher.name, teacher.subject)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(score.sid, score.subject, score.score, teacher.tid, teacher.name, teacher.subject)]), filter(nil), rowset=256, dop=2
2 - output([teacher.subject], [score.subject], [score.sid], [score.score], [teacher.tid], [teacher.name]), filter(nil), rowset=256,
equal_conds([teacher.subject = score.subject]), other_conds(nil)
3 - output([score.subject], [score.sid], [score.score]), filter(nil), rowset=256
4 - output([score.subject], [score.sid], [score.score]), filter(nil), rowset=256, dop=2
5 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
6 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
7 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), rowset=256
8 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), rowset=256,
access([teacher.tid], [teacher.subject], [teacher.name]), partitions(p1)
select /*+ USE_PX parallel(2) */ * from score, teacher where teacher.subject = score.subject and teacher.tid = 1;
sid subject score tid name subject
@ -176,7 +176,7 @@ sid subject score tid name subject
62 EN 90 1 Miss Zhang EN
63 EN 99 1 Miss Zhang EN
64 EN 87 1 Miss Zhang EN
CREATE TABLE product (pid bigint primary key,pname varchar(50),gmt_modify timestamp(6),gmt_create timestamp(6),thread_id bigint, key k (gmt_modify))duplicate_scope="cluster";
CREATE TABLE product (pid bigint primary key,pname varchar(50),gmt_modify timestamp(6),gmt_create timestamp(6),thread_id bigint, key k (gmt_modify));
CREATE TABLE orders (oid bigint primary key,pid bigint,amount int, addr varchar(20),key k (pid) local) partition by hash (oid) partitions 100;
insert into product values(314265, "abcd", now(), now(), 1234);
insert into orders values(314265, 314265, 678, "192.168.1.8");
@ -186,25 +186,6 @@ insert into product values(314267, "abcd", now(), now(), 1234);
insert into orders values(314267, 314267, 678, "192.168.1.8");
insert into product values(314268, "abcd", now(), now(), 1234);
insert into orders values(314268, 314268, 678, "192.168.1.8");
explain select t1.pname,t2.oid,t2.amount from product t1,orders t2 where t2.oid = 314265 and t1.pid=t2.pid;
Query Plan
=========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------------
|0 |NESTED-LOOP JOIN| |1 |89 |
|1 | TABLE GET |t2 |1 |53 |
|2 | TABLE GET |t1 |1 |36 |
=========================================
Outputs & filters:
-------------------------------------
0 - output([t1.pname], [t2.oid], [t2.amount]), filter(nil),
conds(nil), nl_params_([t2.pid])
1 - output([t2.oid], [t2.pid], [t2.amount]), filter(nil),
access([t2.oid], [t2.pid], [t2.amount]), partitions(p65)
2 - output([t1.pname]), filter(nil),
access([t1.pname]), partitions(p0)
select t1.pname,t2.oid,t2.amount from product t1,orders t2 where t2.oid = 314265 and t1.pid=t2.pid;
pname oid amount
abcd 314265 678

View File

@ -73,27 +73,27 @@ Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |12 |118 |
|1 | EXCHANGE OUT DISTR |:EX10000|12 |113 |
|2 | PX PARTITION ITERATOR| |12 |113 |
|3 | MERGE JOIN | |12 |113 |
|4 | SORT | |12 |60 |
|5 | TABLE SCAN |stu |12 |39 |
|6 | TABLE SCAN |score |24 |41 |
|0 |PX COORDINATOR | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | PX PARTITION ITERATOR| |1 |11 |
|3 | MERGE JOIN | |1 |11 |
|4 | TABLE SCAN |score |1 |6 |
|5 | SORT | |1 |6 |
|6 | TABLE SCAN |stu |1 |6 |
====================================================
Outputs & filters:
-------------------------------------
0 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil)
1 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil), dop=2
2 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil)
3 - output([stu.sid], [stu.name], [stu.cls], [score.sid], [score.subject], [score.score]), filter(nil),
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
2 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
3 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
equal_conds([stu.sid = score.sid]), other_conds(nil)
4 - output([stu.sid], [stu.name], [stu.cls]), filter(nil), sort_keys([stu.sid, ASC])
5 - output([stu.sid], [stu.name], [stu.cls]), filter(nil),
access([stu.sid], [stu.name], [stu.cls]), partitions(p[0-5])
6 - output([score.sid], [score.subject], [score.score]), filter(nil),
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
5 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([stu.sid, ASC])
6 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256,
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid;
sid name cls sid subject score

View File

@ -107,7 +107,7 @@ select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ cls, subject, avg(score), max(sc
select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ count(*) from score join stu using (sid) inner join teacher where score.subject = teacher.subject;
select query_sql, EXPECTED_WORKER_COUNT, USED_WORKER_COUNT from oceanbase.gv$sql_audit where EXPECTED_WORKER_COUNT > 0 AND query_sql like '%TEST_SQL_AUDIT%' order by request_time desc limit 10;
select query_sql, EXPECTED_WORKER_COUNT, USED_WORKER_COUNT from oceanbase.GV$OB_SQL_AUDIT where EXPECTED_WORKER_COUNT > 0 AND query_sql like '%TEST_SQL_AUDIT%' order by request_time desc limit 10;
+--------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------+
| query_sql | EXPECTED_WORKER_COUNT | USED_WORKER_COUNT |
+--------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------+
@ -117,7 +117,7 @@ select query_sql, EXPECTED_WORKER_COUNT, USED_WORKER_COUNT from oceanbase.gv$sql
| select /*+ TEST_SQL_AUDIT USE_PX parallel(2) */ subject, avg(score), max(score), min(score) from score group by subject | 4 | 4 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ * from teacher | 3 | 3 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ cls, subject, avg(score), max(score), min(score) from score join stu using (sid) group by cls, subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ count(*) from score join stu using (sid) inner join teacher where score.subject = teacher.subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ count(*) from score join stu using (sid) inner join teacher where score.subject = teacher.subject | 9 | 9 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ subject, avg(score), max(score), min(score) from score group by subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(4) */ * from teacher | 4 | 4 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------+