mark some file to been opensource for ce-farm
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -0,0 +1,83 @@
|
||||
drop table if exists t1;
|
||||
drop table if exists sbtest1;
|
||||
create table t1(nr int, a longtext, b longblob);
|
||||
insert into t1 values(10, repeat('a', 5000), repeat('A', 5000));
|
||||
insert into t1 values(20, repeat('b', 50000), repeat('B', 50000));
|
||||
insert into t1 values(30, repeat('c', 500000), repeat('C', 500000));
|
||||
insert into t1 values(40, repeat('d', 3000000), repeat('D', 3000000));
|
||||
insert into t1 select * from t1;
|
||||
insert into t1 values(1, repeat('e', 2000000), repeat('E', 2000000));
|
||||
insert into t1 select * from t1;
|
||||
insert into t1 values(1, repeat('e', 2000000), repeat('E', 2000000));
|
||||
insert into t1 values(2, repeat('f', 3000000), repeat('F', 3000000));
|
||||
select nr, sum(length(a)), sum(length(b)), substr(a, 1000, 10), substr(b, 1000, 10), count(1) from t1 group by nr order by nr asc;
|
||||
nr sum(length(a)) sum(length(b)) substr(a, 1000, 10) substr(b, 1000, 10) count(1)
|
||||
1 6000000 6000000 eeeeeeeeee EEEEEEEEEE 3
|
||||
2 3000000 3000000 ffffffffff FFFFFFFFFF 1
|
||||
10 20000 20000 aaaaaaaaaa AAAAAAAAAA 4
|
||||
20 200000 200000 bbbbbbbbbb BBBBBBBBBB 4
|
||||
30 2000000 2000000 cccccccccc CCCCCCCCCC 4
|
||||
40 12000000 12000000 dddddddddd DDDDDDDDDD 4
|
||||
alter system major freeze tenant = sys;
|
||||
alter system major freeze tenant = all_user;
|
||||
alter system major freeze tenant = all_meta;
|
||||
select nr, sum(length(a)), sum(length(b)), substr(a, 1000, 10), substr(b, 1000, 10), count(1) from t1 group by nr order by nr asc;
|
||||
nr sum(length(a)) sum(length(b)) substr(a, 1000, 10) substr(b, 1000, 10) count(1)
|
||||
1 6000000 6000000 eeeeeeeeee EEEEEEEEEE 3
|
||||
2 3000000 3000000 ffffffffff FFFFFFFFFF 1
|
||||
10 20000 20000 aaaaaaaaaa AAAAAAAAAA 4
|
||||
20 200000 200000 bbbbbbbbbb BBBBBBBBBB 4
|
||||
30 2000000 2000000 cccccccccc CCCCCCCCCC 4
|
||||
40 12000000 12000000 dddddddddd DDDDDDDDDD 4
|
||||
delete from t1 where nr = 2;
|
||||
update t1 set a = "updated" where nr = 1;
|
||||
select nr, sum(length(a)), sum(length(b)), substr(a, 1, 5), substr(b, 1000, 10), count(1) from t1 group by nr order by nr asc;
|
||||
nr sum(length(a)) sum(length(b)) substr(a, 1, 5) substr(b, 1000, 10) count(1)
|
||||
1 21 6000000 updat EEEEEEEEEE 3
|
||||
10 20000 20000 aaaaa AAAAAAAAAA 4
|
||||
20 200000 200000 bbbbb BBBBBBBBBB 4
|
||||
30 2000000 2000000 ccccc CCCCCCCCCC 4
|
||||
40 12000000 12000000 ddddd DDDDDDDDDD 4
|
||||
alter system major freeze tenant = sys;
|
||||
alter system major freeze tenant = all_user;
|
||||
alter system major freeze tenant = all_meta;
|
||||
select nr, sum(length(a)), sum(length(b)), substr(a, 1, 5), substr(b, 1000, 10), count(1) from t1 group by nr order by nr asc;
|
||||
nr sum(length(a)) sum(length(b)) substr(a, 1, 5) substr(b, 1000, 10) count(1)
|
||||
1 21 6000000 updat EEEEEEEEEE 3
|
||||
10 20000 20000 aaaaa AAAAAAAAAA 4
|
||||
20 200000 200000 bbbbb BBBBBBBBBB 4
|
||||
30 2000000 2000000 ccccc CCCCCCCCCC 4
|
||||
40 12000000 12000000 ddddd DDDDDDDDDD 4
|
||||
drop table t1;
|
||||
CREATE TABLE sbtest1(c1 TINYBLOB NOT NULL);
|
||||
ALTER TABLE sbtest1 ADD COLUMN d int;
|
||||
insert INTO sbtest1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
|
||||
ERROR 23000: Column 'c1' cannot be null
|
||||
insert ignore INTO sbtest1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
|
||||
Warnings:
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
Warning 1048 Column 'c1' cannot be null
|
||||
select * from sbtest1;
|
||||
c1 d
|
||||
10
|
||||
20
|
||||
110
|
||||
120
|
||||
100
|
||||
90
|
||||
drop table sbtest1;
|
||||
create table t1(a decimal(10,0));
|
||||
alter table t1 modify a varbinary(5);
|
||||
INSERT INTO t1 VALUES (10);
|
||||
ALTER TABLE t1 AUTO_INCREMENT=10;
|
||||
ALTER TABLE t1 ADD COLUMN (c INT);
|
||||
ALTER TABLE t1 ADD c2 TIME NOT NULL FIRST;
|
||||
ALTER TABLE t1 ADD c4 LONGTEXT NOT NULL AFTER c2;
|
||||
select * from t1;
|
||||
c2 c4 a c
|
||||
00:00:00 10 NULL
|
||||
drop table t1;
|
||||
@ -0,0 +1,181 @@
|
||||
drop table if exists t1, t2, t3;
|
||||
create table t1(pk int, a longtext, b longblob);
|
||||
create table t2(pk int, a mediumtext, b blob, c tinytext);
|
||||
create table t3(pk int, a longtext);
|
||||
insert into t1 values(1, repeat('a', 5000000), repeat('b', 10000000));
|
||||
insert into t1 values(2, repeat('A', 5000000), repeat('B', 10000000));
|
||||
insert into t2 values(1, repeat('a', 5000000), repeat('b', 60000), repeat('c', 255));
|
||||
insert into t2 values(2, repeat('A', 5000000), repeat('B', 60000), repeat('C', 255));
|
||||
insert into t3 values(1, repeat('a', 5000000));
|
||||
insert into t3 values(1, repeat('A', 5000000));
|
||||
insert into t1 values(1, repeat('a', 200000), repeat('b', 200000));
|
||||
insert into t1 values(2, repeat('A', 200000), repeat('B', 200000));
|
||||
insert into t2 values(1, repeat('a', 100000), repeat('b', 60000), repeat('c', 255));
|
||||
insert into t2 values(2, repeat('A', 100000), repeat('B', 60000), repeat('C', 255));
|
||||
insert into t3 values(1, repeat('a', 50000));
|
||||
insert into t3 values(1, repeat('A', 50000));
|
||||
select pk, length(a), length(b) from t1 order by 1 asc, 2;
|
||||
pk length(a) length(b)
|
||||
1 200000 200000
|
||||
1 5000000 10000000
|
||||
2 200000 200000
|
||||
2 5000000 10000000
|
||||
select pk, length(a), length(b), length(c) from t2 order by 1 asc, 2;
|
||||
pk length(a) length(b) length(c)
|
||||
1 100000 60000 255
|
||||
1 5000000 60000 255
|
||||
2 100000 60000 255
|
||||
2 5000000 60000 255
|
||||
select pk, length(a) from t3 order by 1 asc, 2;
|
||||
pk length(a)
|
||||
1 50000
|
||||
1 50000
|
||||
1 5000000
|
||||
1 5000000
|
||||
explain basic select * from t1 where t1.a in( select /*+ use_nl(x, y) */ x.a from t1 x, t1 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
Query Plan
|
||||
======================================
|
||||
|ID|OPERATOR |NAME |
|
||||
--------------------------------------
|
||||
|0 |SORT | |
|
||||
|1 |└─HASH JOIN | |
|
||||
|2 | ├─SUBPLAN SCAN |VIEW1|
|
||||
|3 | │ └─LIMIT | |
|
||||
|4 | │ └─NESTED-LOOP JOIN | |
|
||||
|5 | │ ├─TABLE FULL SCAN |y |
|
||||
|6 | │ └─MATERIAL | |
|
||||
|7 | │ └─TABLE FULL SCAN|x |
|
||||
|8 | └─TABLE FULL SCAN |t1 |
|
||||
======================================
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.pk], [t1.a], [t1.b]), filter(nil)
|
||||
sort_keys([t1.pk, ASC])
|
||||
1 - output([t1.pk], [t1.a], [t1.b]), filter(nil)
|
||||
equal_conds([t1.a = VIEW1.a]), other_conds(nil)
|
||||
2 - output([VIEW1.a]), filter(nil)
|
||||
access([VIEW1.a])
|
||||
3 - output([x.a]), filter(nil)
|
||||
limit(1), offset(nil)
|
||||
4 - output([x.a]), filter(nil)
|
||||
conds([x.pk = y.pk]), nl_params_(nil), use_batch=false
|
||||
5 - output([y.pk]), filter(nil)
|
||||
access([y.pk]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([y.__pk_increment]), range(MIN ; MAX)always true
|
||||
6 - output([x.a], [x.pk]), filter(nil)
|
||||
7 - output([x.pk], [x.a]), filter(nil)
|
||||
access([x.pk], [x.a]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([x.__pk_increment]), range(MIN ; MAX)always true
|
||||
8 - output([t1.a], [t1.pk], [t1.b]), filter(nil)
|
||||
access([t1.a], [t1.pk], [t1.b]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
|
||||
select pk, length(a), substr(a, 1, 5), length(b), substr(b, 1, 5) from t1 where (t1.a, t1.b) in( select /*+ use_nl(x, y) */ x.a, x.b from t1 x, t1 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
pk length(a) substr(a, 1, 5) length(b) substr(b, 1, 5)
|
||||
1 5000000 aaaaa 10000000 bbbbb
|
||||
select pk, length(a), substr(a, 1, 5), length(b), substr(b, 1, 5), length(c), substr(c, 1, 5) from t2 where (t2.a, t2.b) in( select /*+ use_nl(x, y) */ x.a, x.b from t2 x, t2 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
pk length(a) substr(a, 1, 5) length(b) substr(b, 1, 5) length(c) substr(c, 1, 5)
|
||||
1 5000000 aaaaa 60000 bbbbb 255 ccccc
|
||||
select pk, length(a), substr(a, 1, 5) from t3 where t3.a in( select /*+ use_nl(x, y) */ x.a from t3 x, t3 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
pk length(a) substr(a, 1, 5)
|
||||
1 5000000 aaaaa
|
||||
1 5000000 AAAAA
|
||||
explain basic select * from t1 where t1.a in( select /*+ use_hash(x, y) */ x.a from t1 x, t1 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
Query Plan
|
||||
====================================
|
||||
|ID|OPERATOR |NAME |
|
||||
------------------------------------
|
||||
|0 |SORT | |
|
||||
|1 |└─HASH JOIN | |
|
||||
|2 | ├─SUBPLAN SCAN |VIEW1|
|
||||
|3 | │ └─LIMIT | |
|
||||
|4 | │ └─HASH JOIN | |
|
||||
|5 | │ ├─TABLE FULL SCAN|y |
|
||||
|6 | │ └─TABLE FULL SCAN|x |
|
||||
|7 | └─TABLE FULL SCAN |t1 |
|
||||
====================================
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.pk], [t1.a], [t1.b]), filter(nil)
|
||||
sort_keys([t1.pk, ASC])
|
||||
1 - output([t1.pk], [t1.a], [t1.b]), filter(nil)
|
||||
equal_conds([t1.a = VIEW1.a]), other_conds(nil)
|
||||
2 - output([VIEW1.a]), filter(nil)
|
||||
access([VIEW1.a])
|
||||
3 - output([x.a]), filter(nil)
|
||||
limit(1), offset(nil)
|
||||
4 - output([x.a]), filter(nil)
|
||||
equal_conds([x.pk = y.pk]), other_conds(nil)
|
||||
5 - output([y.pk]), filter(nil)
|
||||
access([y.pk]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([y.__pk_increment]), range(MIN ; MAX)always true
|
||||
6 - output([x.pk], [x.a]), filter(nil)
|
||||
access([x.pk], [x.a]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([x.__pk_increment]), range(MIN ; MAX)always true
|
||||
7 - output([t1.a], [t1.pk], [t1.b]), filter(nil)
|
||||
access([t1.a], [t1.pk], [t1.b]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
|
||||
select pk, length(a), substr(a, 1, 5), length(b), substr(b, 1, 5) from t1 where (t1.a, t1.b) in( select /*+ use_hash(x, y) */ x.a, x.b from t1 x, t1 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
pk length(a) substr(a, 1, 5) length(b) substr(b, 1, 5)
|
||||
1 5000000 aaaaa 10000000 bbbbb
|
||||
select pk, length(a), substr(a, 1, 5), length(b), substr(b, 1, 5), length(c), substr(c, 1, 5) from t2 where (t2.a, t2.b) in( select /*+ use_hash(x, y) */ x.a, x.b from t2 x, t2 y where x.pk = y.pk limit 1) order by pk asc;
|
||||
pk length(a) substr(a, 1, 5) length(b) substr(b, 1, 5) length(c) substr(c, 1, 5)
|
||||
1 5000000 aaaaa 60000 bbbbb 255 ccccc
|
||||
select pk, length(a), substr(a, 1, 5) from t3 where t3.a in( select /*+ use_hash(x, y) */ x.a from t3 x, t3 y where x.pk = y.pk limit 1);
|
||||
pk length(a) substr(a, 1, 5)
|
||||
1 5000000 aaaaa
|
||||
1 5000000 AAAAA
|
||||
explain basic select pk, length(a), substr(a, 1, 5) from t1 where t1.a in( select a from t1 union select a from t2) order by pk asc;
|
||||
Query Plan
|
||||
====================================
|
||||
|ID|OPERATOR |NAME |
|
||||
------------------------------------
|
||||
|0 |SORT | |
|
||||
|1 |└─HASH JOIN | |
|
||||
|2 | ├─TABLE FULL SCAN |t1 |
|
||||
|3 | └─SUBPLAN SCAN |VIEW1|
|
||||
|4 | └─HASH UNION DISTINCT| |
|
||||
|5 | ├─TABLE FULL SCAN |t1 |
|
||||
|6 | └─TABLE FULL SCAN |t2 |
|
||||
====================================
|
||||
Outputs & filters:
|
||||
-------------------------------------
|
||||
0 - output([t1.pk], [length(t1.a)], [substr(t1.a, 1, 5)]), filter(nil)
|
||||
sort_keys([t1.pk, ASC])
|
||||
1 - output([t1.pk], [t1.a]), filter(nil)
|
||||
equal_conds([t1.a = VIEW1.a]), other_conds(nil)
|
||||
2 - output([t1.a], [t1.pk]), filter(nil)
|
||||
access([t1.a], [t1.pk]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
|
||||
3 - output([VIEW1.a]), filter(nil)
|
||||
access([VIEW1.a])
|
||||
4 - output([UNION([1])]), filter(nil)
|
||||
5 - output([t1.a]), filter(nil)
|
||||
access([t1.a]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
|
||||
6 - output([cast(t2.a, LONGTEXT(536870911))]), filter(nil)
|
||||
access([t2.a]), partitions(p0)
|
||||
is_index_back=false, is_global_index=false,
|
||||
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
|
||||
select pk, length(a), substr(a, 1, 5) from t1 where t1.a in( select a from t1 union select a from t2) order by 1 asc,2;
|
||||
pk length(a) substr(a, 1, 5)
|
||||
1 200000 aaaaa
|
||||
1 5000000 aaaaa
|
||||
2 200000 AAAAA
|
||||
2 5000000 AAAAA
|
||||
select pk, length(a), substr(a, 1, 5) from t1 where t1.a in( select a from t1 except select a from t2) order by 1 asc,2;
|
||||
pk length(a) substr(a, 1, 5)
|
||||
1 200000 aaaaa
|
||||
2 200000 AAAAA
|
||||
select pk, length(a), substr(a, 1, 5) from t1 where t1.a in( select a from t1 intersect select a from t2) order by 1 asc,2;
|
||||
pk length(a) substr(a, 1, 5)
|
||||
1 5000000 aaaaa
|
||||
2 5000000 AAAAA
|
||||
drop table if exists t1, t2, t3;
|
||||
Reference in New Issue
Block a user