Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
aa0fd5ca
Commit
aa0fd5ca
authored
Oct 17, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6388: ANALYZE $stmt output in the slow query log
Add testcase.
parent
47ced655
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
mysql-test/r/analyze_stmt_slow_query_log.result
mysql-test/r/analyze_stmt_slow_query_log.result
+17
-0
mysql-test/t/analyze_stmt_slow_query_log-master.opt
mysql-test/t/analyze_stmt_slow_query_log-master.opt
+1
-0
mysql-test/t/analyze_stmt_slow_query_log.test
mysql-test/t/analyze_stmt_slow_query_log.test
+24
-0
No files found.
mysql-test/r/analyze_stmt_slow_query_log.result
0 → 100644
View file @
aa0fd5ca
drop table if exists t1;
create table t1 (a int);
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select * from t1 where a<3;
a
0
1
2
drop table t1;
# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
# explain: 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
# explain: 1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL
# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
# explain: 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10 100.00 30.00 Using where
# explain: id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
# explain: 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
mysql-test/t/analyze_stmt_slow_query_log-master.opt
0 → 100644
View file @
aa0fd5ca
--slow-query-log --long-query-time=0.00001 --log-slow-verbosity=query_plan,explain
mysql-test/t/analyze_stmt_slow_query_log.test
0 → 100644
View file @
aa0fd5ca
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
select
*
from
t1
where
a
<
3
;
drop
table
t1
;
let
SLOW_LOG_FILE
=
`select @@slow_query_log_file`
;
# select @@slow_query_log_file;
perl
;
my
$slow_log_file
=
$ENV
{
'SLOW_LOG_FILE'
}
or
die
"SLOW_LOG_FILE not set"
;
open
(
FILE
,
$slow_log_file
)
or
die
"Failed to open
$slow_log_file
"
;
while
(
<
FILE
>
)
{
if
(
/
explain
:/
)
{
print
$_
;
}
}
close
(
FILE
);
EOF
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment