-
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
提交
取消