12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-26 22:10:01
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
使用mysql自带的工具profiling1.查看是否打开mysql> show variables like '%pro%';+---------------------------+-------+| Variable_name | Value |+------------
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
使用mysql自带的工具profiling
1.查看是否打开
mysql> show variables like '%pro%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| have_profiling| YES|
| profiling | OFF|
| profiling_history_size| 15|
| protocol_version | 10|
| proxy_user||
| slave_compressed_protocol | OFF|
| stored_program_cache | 256|
+---------------------------+-------+
7 rows in set (0.00 sec)
2.默认是关闭的
打开它
setprofiling=1;
3.使用
select * from corp_base_par where res_date=330000 limit 1;
mysql> show profiles;
+----------+------------+-----------------------------------------------------------+
| Query_ID | Duration| Query |
+----------+------------+-----------------------------------------------------------+
|1 | 0.00008975 | set profiling=1 |
|2 | 0.00088450 | select * from corp_base_par where res_date=330000 limit 1 |
+----------+------------+-----------------------------------------------------------+
2 rows in set (0.00 sec)
显示了 这条sql的具体消耗时间
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19