1
drop table if exists t1;
3
(a int auto_increment primary key,
6
'#--------------------FN_DYNVARS_084_01-------------------------#'
7
SELECT @@global.max_seeks_for_key = 10;
8
@@global.max_seeks_for_key = 10
10
SELECT @@session.max_seeks_for_key = 10;
11
@@session.max_seeks_for_key = 10
13
SET @@global.max_seeks_for_key = 20;
14
SELECT @@global.max_seeks_for_key;
15
@@global.max_seeks_for_key
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
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
36
SELECT @@session.max_seeks_for_key = 10;
37
@@session.max_seeks_for_key = 10
39
SET @@global.max_seeks_for_key = 20;
40
SELECT @@global.max_seeks_for_key;
41
@@global.max_seeks_for_key
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
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
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;