Slow query log improvements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Triaged
|
Wishlist
|
Unassigned | ||
5.5 |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
We recently encountered an issue with a particular type of query was not using the right index and resulted in doing a filesort-on-disk. The query itself was fast (taking < 100ms) but there were many processes were running these with different parameters. Soon the bottleneck became write IO and the server stalled. The server had long_query_time as 1s.
We realized there's currently no way to gain visibility into queries doing tmp/filesort based disk IO.
The attached patch helps solve that by adding a new variable "log_slow_override" with similar values as "log_slow_filter". It will log statements to the slow query log that match certain execution plans irrespective of what long_query_time is. It also guesstimate the size of the filesort disk-file and adds it to the log file.
The patch also fixes a couple of other bugs:
1) The enum enum_log_
2) The char* array log_slow_
The patch is based off of Percona- Server- 5.5.27- rel28.1