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

@ -68,10 +68,7 @@ ERROR 21000: Subquery returns more than 1 row
select * from t1 order by c1,(select c1 from t5 order by c1,(select c1 from t3));
ERROR 21000: Subquery returns more than 1 row
(select * from t1 order by c1,(select c1 from t5 order by c1,(select c1 from t3))) intersect (select * from t1 order by c1,(select c1 from t5 order by c1,(select c1 from t3)));
c1 c2 c3
1 1 1
2 2 2
3 3 3
ERROR 21000: Subquery returns more than 1 row
(select * from t1 order by c1,(select c1 from t5 order by c1)) intersect (select * from t1 order by c1,(select c1 from t5 order by c1));
c1 c2 c3
1 1 1

View File

@ -35,18 +35,18 @@ Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |4 |83 |
|1 | TABLE SCAN |t1 |3 |37 |
|2 | TABLE SCAN |t2 |10 |38 |
|0 |HASH RIGHT SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2 |10 |3 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t2.a], [t2.b]), filter(nil),
0 - output([t2.a], [t2.b]), filter(nil), rowset=256,
equal_conds([t2.b = t1.a]), other_conds(nil)
1 - output([t1.a]), filter(nil),
1 - output([t1.a]), filter(nil), rowset=256,
access([t1.a]), partitions(p0)
2 - output([t2.b], [t2.a]), filter(nil),
2 - output([t2.b], [t2.a]), filter(nil), rowset=256,
access([t2.b], [t2.a]), partitions(p0)
select * from t2 where b in (select a from t1);
@ -68,19 +68,19 @@ Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |4 |83 |
|1 | TABLE SCAN |t1 |3 |37 |
|2 | TABLE SCAN |t3 |10 |39 |
|0 |HASH RIGHT SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t3 |10 |3 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2], [t3.pk3]), filter(nil),
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2], [t3.pk3]), filter(nil), rowset=256,
equal_conds([t3.b = t1.a]), other_conds(nil)
1 - output([t1.a]), filter(nil),
1 - output([t1.a]), filter(nil), rowset=256,
access([t1.a]), partitions(p0)
2 - output([t3.b], [t3.a], [t3.pk1], [t3.pk2], [t3.pk3]), filter(nil),
access([t3.b], [t3.a], [t3.pk1], [t3.pk2], [t3.pk3]), partitions(p0)
2 - output([t3.pk1], [t3.pk2], [t3.pk3], [t3.b], [t3.a]), filter(nil), rowset=256,
access([t3.pk1], [t3.pk2], [t3.pk3], [t3.b], [t3.a]), partitions(p0)
select * from t3 where b in (select a from t1);
a b pk1 pk2 pk3
@ -102,19 +102,19 @@ Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |10 |118 |
|1 | TABLE SCAN |t0 |10 |38 |
|2 | TABLE SCAN |t3 |50 |48 |
|0 |HASH RIGHT SEMI JOIN| |10 |15 |
|1 | TABLE SCAN |t0 |10 |3 |
|2 | TABLE SCAN |t3 |50 |7 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2]), filter(nil),
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2]), filter(nil), rowset=256,
equal_conds([t3.b = t0.a]), other_conds(nil)
1 - output([t0.a]), filter(nil),
1 - output([t0.a]), filter(nil), rowset=256,
access([t0.a]), partitions(p0)
2 - output([t3.b], [t3.a], [t3.pk1], [t3.pk2]), filter(nil),
access([t3.b], [t3.a], [t3.pk1], [t3.pk2]), partitions(p0)
2 - output([t3.pk1], [t3.pk2], [t3.b], [t3.a]), filter(nil), rowset=256,
access([t3.pk1], [t3.pk2], [t3.b], [t3.a]), partitions(p0)
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
@ -134,23 +134,21 @@ a b pk1 pk2
9 9 9 9
explain select * from t1 where a in (select b from t2);
Query Plan
=========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-----------------------------------------
|0 |MERGE SEMI JOIN| |3 |81 |
|1 | SORT | |3 |39 |
|2 | TABLE SCAN |t1 |3 |37 |
|3 | TABLE SCAN |t2(b)|10 |38 |
=========================================
========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------
|0 |HASH SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2(b)|10 |3 |
========================================
Outputs & filters:
-------------------------------------
0 - output([t1.a], [t1.b]), filter(nil),
0 - output([t1.a], [t1.b]), filter(nil), rowset=256,
equal_conds([t1.a = t2.b]), other_conds(nil)
1 - output([t1.a], [t1.b]), filter(nil), sort_keys([t1.a, ASC])
2 - output([t1.a], [t1.b]), filter(nil),
1 - output([t1.a], [t1.b]), filter(nil), rowset=256,
access([t1.a], [t1.b]), partitions(p0)
3 - output([t2.b]), filter(nil),
2 - output([t2.b]), filter(nil), rowset=256,
access([t2.b]), partitions(p0)
select * from t1;
@ -191,40 +189,33 @@ explain select 1 from t2 where
c2 in (select 1 from t3, t2) and
c1 in (select convert(c6,char(1)) from t2);
Query Plan
==========================================================
|ID|OPERATOR |NAME |EST. ROWS|COST |
----------------------------------------------------------
|0 |HASH SEMI JOIN | |3 |235035|
|1 | HASH JOIN | |500 |99905 |
|2 | SUBPLAN SCAN |VIEW1|1 |74 |
|3 | LIMIT | |1 |74 |
|4 | NESTED-LOOP JOIN CARTESIAN| |1 |73 |
|5 | TABLE SCAN |t2 |1 |36 |
|6 | MATERIAL | |2 |37 |
|7 | TABLE SCAN |t3 |2 |37 |
|8 | TABLE SCAN |t2 |100000 |64066 |
|9 | TABLE SCAN |t2 |100000 |61860 |
==========================================================
=====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-----------------------------------------------------
|0 |HASH SEMI JOIN | |1 |6 |
|1 | NESTED-LOOP JOIN CARTESIAN| |1 |4 |
|2 | TABLE SCAN |t2 |1 |2 |
|3 | MATERIAL | |1 |2 |
|4 | SUBPLAN SCAN |VIEW3|1 |2 |
|5 | TABLE SCAN |t3 |1 |2 |
|6 | TABLE SCAN |t2 |1 |2 |
=====================================================
Outputs & filters:
-------------------------------------
0 - output([1]), filter(nil),
0 - output([1]), filter(nil), rowset=256,
equal_conds([cast(t2.c1, VARCHAR(1048576)) = cast(cast(t2.c6, CHAR(1)), VARCHAR(1048576))]), other_conds(nil)
1 - output([cast(t2.c1, VARCHAR(1048576))]), filter(nil),
equal_conds([cast(t2.c2, DECIMAL(-1, -1)) = VIEW1.1]), other_conds(nil)
2 - output([VIEW1.1]), filter(nil),
access([VIEW1.1])
3 - output([?]), filter(nil), limit(1), offset(nil)
4 - output([1]), filter(nil),
1 - output([t2.c1]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
5 - output([1]), filter(nil),
access([t2.__pk_increment]), partitions(p0)
6 - output([1]), filter(nil)
7 - output([1]), filter(nil),
access([t3.__pk_increment]), partitions(p0)
8 - output([t2.c1], [cast(t2.c2, DECIMAL(-1, -1))]), filter(nil),
2 - output([t2.c1]), filter([cast(t2.c2, DECIMAL(-1, -1)) = cast(1, DECIMAL(1, 0))]), rowset=256,
access([t2.c2], [t2.c1]), partitions(p0)
9 - output([cast(cast(t2.c6, CHAR(1)), VARCHAR(1048576))]), filter(nil),
3 - output(nil), filter(nil), rowset=256
4 - output(nil), filter(nil), rowset=256,
access(nil)
5 - output([1]), filter(nil), rowset=256,
access(nil), partitions(p0),
limit(1), offset(nil)
6 - output([t2.c6]), filter(nil), rowset=256,
access([t2.c6]), partitions(p0)
drop table t2, t3;