mysql慢查詢的奇異事件
開啟mysql慢查詢日誌,發現有很多sql查詢時間很短,明顯不到0.01s的sql竟然也在慢日誌查詢裡面,日誌詳細情況如下:
# User@Host: otterpro[otterpro] @ [172.22.53.122] Id: 2061
# Schema: otter Last_errno: 0 Killed: 0
# Query_time: 0.000559 Lock_time: 0.000080 Rows_sent: 3 Rows_examined: 327 Rows_affected: 0
# Bytes_sent: 755
SET timestamp=1512715920;
select ID,NODE_ID,PIPELINE_ID,LOCATION,GMT_CREATE,GMT_MODIFIED from PIPELINE_NODE_RELATION where NODE_ID = 74 ORDER BY ID DESC;
# Time: 171208 14:52:08
# User@Host: otterpro[otterpro] @ [172.22.53.122] Id: 2061
# Schema: otter Last_errno: 0 Killed: 0
# Query_time: 0.000214 Lock_time: 0.000110 Rows_sent: 2 Rows_examined: 2 Rows_affected: 0
# Bytes_sent: 821
SET timestamp=1512715928;
select ID,CLUSTER_NAME,SERVER_LIST,DESCRIPTION,GMT_CREATE,GMT_MODIFIED from AUTOKEEPER_CLUSTER ORDER BY ID ASC;
有點懷疑再次檢視了引數:
+---------------+---------+
| Variable_name | Value |
+---------------+---------+
| Slow_queries | 6055683 |
+---------------+---------+
mysql> show variables like '%slow_query_log%';
+------------------------------------+--------------------------------+
| Variable_name | Value |
+------------------------------------+--------------------------------+
| slow_query_log | ON |
| slow_query_log_always_write_time | 10.000000 |
| slow_query_log_file | /data/mysql/13306/tmp/slow.log |
| slow_query_log_timestamp_always | OFF |
| slow_query_log_timestamp_precision | second |
| slow_query_log_use_global_control | |
+------------------------------------+--------------------------------+
6 rows in set (0.01 sec)
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| long_query_time | 0.100000 |
+-----------------+----------+
1 row in set (0.00 sec)
mysql> show global variables like '%general%';
+------------------+--------------------------------+
| Variable_name | Value |
+------------------+--------------------------------+
| general_log | OFF |
| general_log_file | /data/mysql/13306/tmp/file.sql |
+------------------+--------------------------------+
2 rows in set (0.00 sec)
log-queries-not-using-indexes
如果執行的SQL語句沒有使用索引,則mysql資料庫同樣會將這條SQL語句記錄到慢查詢日誌檔案中。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28686045/viewspace-2148532/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 詭異的”慢查詢“
- MySQL慢查詢MySql
- MySQL 慢查詢MySql
- MySQL:慢查詢日誌MySql
- MySQL 慢查詢優化MySql優化
- 【mysql】explain命令分析慢查詢MySqlAI
- [Mysql]慢查詢最佳化MySql
- MySQL 慢查詢那點事MySql
- 詳解MySQL--慢查詢MySql
- mysql查詢效率慢的SQL語句MySql
- MySQL慢查詢分析工具之mysqldumpslowMySql
- Mysql 慢查詢優化實踐MySql優化
- 盤點MySQL慢查詢的12個原因MySql
- 深入mysql慢查詢設定的詳解MySql
- 在mysql查詢效率慢的SQL語句MySql
- 慢查詢
- MySQL Slow Query log(慢查詢日誌)MySql
- mysql慢查詢,死鎖解決方案MySql
- mysql之 slow log 慢查詢日誌MySql
- 對 MySQL 慢查詢日誌的簡單分析MySql
- 關於MySQL 通用查詢日誌和慢查詢日誌分析MySql
- Mysql慢查詢日誌檔案轉ExcelMySqlExcel
- MySQL慢查詢日誌相關設定MySql
- MySQL索引原理及慢查詢最佳化MySql索引
- mysql5.7.10開啟慢查詢詳解MySql
- mysql慢查詢和錯誤日誌分析MySql
- 【趙渝強老師】MySQL的慢查詢日誌MySql
- MySQL information_schema.columns表查詢慢原因分析MySqlORM
- 如何在MySQL中開啟慢查詢日誌?MySql
- MySQL慢查詢記錄原理和內容解析MySql
- mongodb慢查詢分析MongoDB
- 遇到慢查詢怎麼辦?一文解讀MySQL 8.0查詢分析工具MySql
- MySQL 慢查詢分析工具~pt-query-digest 詳解MySql
- mysql 表資料量大量查詢慢如何優化MySql優化
- MySQL:RR模式下insert也可能導致查詢慢MySql模式
- 資料庫查詢慢的原因資料庫
- MongoDB慢查詢與索引MongoDB索引
- SQL慢查詢排查思路SQL
- 分分鐘解決MySQL查詢速度慢與效能差MySql