~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/r/max_seeks_for_key_func.result

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
CREATE TABLE t1
 
3
(a int auto_increment primary key, 
 
4
b char(20)
 
5
);
 
6
'#--------------------FN_DYNVARS_084_01-------------------------#'
 
7
SELECT @@global.max_seeks_for_key = 10;
 
8
@@global.max_seeks_for_key = 10
 
9
0
 
10
SELECT @@session.max_seeks_for_key = 10;
 
11
@@session.max_seeks_for_key = 10
 
12
0
 
13
SET @@global.max_seeks_for_key = 20;
 
14
SELECT @@global.max_seeks_for_key;
 
15
@@global.max_seeks_for_key
 
16
20
 
17
INSERT into t1(b) values("AREc");
 
18
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
19
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
20
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       
 
21
1       SIMPLE  t2      system  NULL    NULL    NULL    NULL    1       
 
22
SET @@session.max_seeks_for_key = 2;
 
23
SELECT @@session.max_seeks_for_key;
 
24
@@session.max_seeks_for_key
 
25
2
 
26
INSERT into t1(b) values("BREc");
 
27
INSERT into t1(b) values("CRec");
 
28
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
29
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
30
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    3       
 
31
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    3       Using where; Using join buffer
 
32
'#--------------------FN_DYNVARS_084_02-------------------------#'
 
33
SELECT @@global.max_seeks_for_key = 10;
 
34
@@global.max_seeks_for_key = 10
 
35
0
 
36
SELECT @@session.max_seeks_for_key = 10;
 
37
@@session.max_seeks_for_key = 10
 
38
0
 
39
SET @@global.max_seeks_for_key = 20;
 
40
SELECT @@global.max_seeks_for_key;
 
41
@@global.max_seeks_for_key
 
42
20
 
43
INSERT into t1(b) values("AREc");
 
44
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
45
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
46
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    4       
 
47
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    4       Using where; Using join buffer
 
48
SET @@session.max_seeks_for_key = 2;
 
49
SELECT @@session.max_seeks_for_key;
 
50
@@session.max_seeks_for_key
 
51
2
 
52
INSERT into t1(b) values("BREc");
 
53
INSERT into t1(b) values("CRec");
 
54
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
55
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
56
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    6       
 
57
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    6       Using where; Using join buffer
 
58
INSERT INTO t1 values(null,"test");
 
59
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
 
60
(null,"a"),(null,"a"),(null,"a"),(null,"a"),
 
61
(null,"a"),(null,"a"),(null,"a");
 
62
explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
63
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
64
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    17      
 
65
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    17      Using where; Using join buffer
 
66
analyze table t1;
 
67
Table   Op      Msg_type        Msg_text
 
68
test.t1 analyze status  OK
 
69
SET MAX_SEEKS_FOR_KEY=1;
 
70
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
 
71
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
72
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    17      
 
73
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    17      Using where; Using join buffer
 
74
SET MAX_SEEKS_FOR_KEY=DEFAULT;
 
75
drop table t1;