-
explain 返回各列的含义 extra列需要注意的返回值 Using filesort:看到这个的时候,查询就需要优化了 Using temporary 看到这个的时候,也需要优化,查看全部
-
mysql> explain select customer_id,first_name,last_name from customer; +----+-------------+----------+------+---------------+------+---------+------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+------+---------------+------+---------+------+------+-------+ | 1 | SIMPLE | customer | ALL | NULL | NULL | NULL | NULL | 599 | NULL | +----+-------------+----------+------+---------------+------+---------+------+------+-------+ 1 row in set (0.00 sec)查看全部
-
+----+-------------+----------+------+---------------+------+---------+------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+------+---------------+------+---------+------+------+-------+ | 1 | SIMPLE | customer | ALL | NULL | NULL | NULL | NULL | 599 | NULL | +----+-------------+----------+------+---------------+------+---------+------+------+-------+ 1 row in set (0.00 sec)查看全部
-
所用时间占比高,关注优化之 扫描行数多,占用io大 扫描的行数远远大于发送的行数的话,索引优化查看全部
-
慢查询工具 pt-query-digest查看全部
-
日志内容查看全部
-
show variables like '%log%';查看全部
-
show variables like 'slow_query_log'; 通过这个命令来查看慢查询的状态查看全部
-
查看数据库版本,进入数据库控制台后 输入命令 select @@version;查看全部
-
通常不要超过100毫秒查看全部
-
开启慢查询日志查看全部
-
dev.mysql.com/doc/index-other.html dev.mysql.com/doc/sakila/en/sakila-installation.html查看全部
-
数据库优化考虑 的几个方面查看全部
-
mysql> select a.table_schema as '???',a.table_name as '??',a.index_name as '??1',b.index_name as '??2' -> ,a.column_name as '?????' from statistics a join statistics b on a.table_schema =b.table_schema -> and a.table_name = b.table_name and a.seq_in_index = b.seq_in_index and a.column_name = b.column_name -> where a.seq_in_index = 1 and a.index_name<>b.index_name; Empty set (0.48 sec)查看全部
-
冗余索引查看全部
举报
0/150
提交
取消