1
by brian
clean slate |
1 |
flush status;
|
734
by Brian Aker
Merging Stewart (one fix to his test case to drop t1 if left from previous |
2 |
drop table if exists t1;
|
1
by brian
clean slate |
3 |
select 1;
|
4 |
1
|
|
5 |
1
|
|
6 |
show status like 'last_query_cost';
|
|
7 |
Variable_name Value
|
|
8 |
Last_query_cost 0.000000
|
|
673.3.31
by Stewart Smith
status test: remove bits not applicable to Drizzle, explicitly use MyISAM in a few places to get stable costs |
9 |
create table t1 (a int) engine=myisam;
|
1
by brian
clean slate |
10 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
11 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|
12 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|
13 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|
14 |
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|
15 |
select * from t1 where a=6;
|
|
16 |
a
|
|
17 |
6
|
|
18 |
6
|
|
19 |
6
|
|
20 |
6
|
|
21 |
6
|
|
22 |
show status like 'last_query_cost';
|
|
23 |
Variable_name Value
|
|
24 |
Last_query_cost 12.084449
|
|
25 |
show status like 'last_query_cost';
|
|
26 |
Variable_name Value
|
|
27 |
Last_query_cost 12.084449
|
|
28 |
select 1;
|
|
29 |
1
|
|
30 |
1
|
|
31 |
show status like 'last_query_cost';
|
|
32 |
Variable_name Value
|
|
33 |
Last_query_cost 0.000000
|
|
34 |
drop table t1;
|
|
35 |
FLUSH STATUS;
|
|
36 |
SHOW STATUS LIKE 'max_used_connections';
|
|
37 |
Variable_name Value
|
|
38 |
Max_used_connections 1
|
|
39 |
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
|
|
40 |
VARIABLE_NAME VARIABLE_VALUE
|
|
41 |
MAX_USED_CONNECTIONS 1
|
|
673.3.31
by Stewart Smith
status test: remove bits not applicable to Drizzle, explicitly use MyISAM in a few places to get stable costs |
42 |
SHOW STATUS LIKE 'max_used_connections';
|
43 |
Variable_name Value
|
|
44 |
Max_used_connections 3
|
|
45 |
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
|
|
46 |
VARIABLE_NAME VARIABLE_VALUE
|
|
47 |
MAX_USED_CONNECTIONS 3
|
|
48 |
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
|
|
1
by brian
clean slate |
49 |
INSERT INTO t1 VALUES (1), (2);
|
50 |
SELECT a FROM t1 LIMIT 1;
|
|
51 |
a
|
|
52 |
1
|
|
53 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
54 |
Variable_name Value
|
|
55 |
Last_query_cost 2.402418
|
|
56 |
EXPLAIN SELECT a FROM t1;
|
|
57 |
id select_type table type possible_keys key key_len ref rows Extra
|
|
58 |
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
|
59 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
60 |
Variable_name Value
|
|
61 |
Last_query_cost 2.402418
|
|
62 |
SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
|
|
63 |
a
|
|
64 |
1
|
|
65 |
2
|
|
66 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
67 |
Variable_name Value
|
|
68 |
Last_query_cost 0.000000
|
|
69 |
EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
|
|
70 |
id select_type table type possible_keys key key_len ref rows Extra
|
|
71 |
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
|
72 |
2 UNION t1 ALL NULL NULL NULL NULL 2
|
|
73 |
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
|
|
74 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
75 |
Variable_name Value
|
|
76 |
Last_query_cost 0.000000
|
|
77 |
SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1;
|
|
78 |
a IN (SELECT a FROM t1)
|
|
79 |
1
|
|
80 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
81 |
Variable_name Value
|
|
82 |
Last_query_cost 0.000000
|
|
83 |
SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
|
|
84 |
x
|
|
85 |
1
|
|
86 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
87 |
Variable_name Value
|
|
88 |
Last_query_cost 0.000000
|
|
89 |
SELECT * FROM t1 a, t1 b LIMIT 1;
|
|
90 |
a a
|
|
91 |
1 1
|
|
92 |
SHOW SESSION STATUS LIKE 'Last_query_cost';
|
|
93 |
Variable_name Value
|
|
94 |
Last_query_cost 4.805836
|
|
95 |
DROP TABLE t1;
|