[MDEV-407] Print EXPLAIN [ANALYZE] in the slow query log Created: 2012-07-20 Updated: 2014-06-25 Resolved: 2013-11-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
SHOW EXPLAIN allows to produce EXPLAIN during the query execution. We are now able to save it in the slow query log. The user interface is as follows: "explain" is a new flag in log-slow-verbosity argument:
The output is printed into slow query log like this:
|
| Comments |
| Comment by Sergei Petrunia [ 2013-09-18 ] |
|
Stack trace of where currently "query plan" information is written into the query log: #0 MYSQL_QUERY_LOG::write |
| Comment by Sergei Petrunia [ 2013-09-19 ] |
|
The first patch is at lp:~maria-captains/maria/10.0-base-explain-slowquerylog |
| Comment by Sergei Petrunia [ 2013-09-20 ] |
|
Currently, EXPLAIN is only printed into the slow query log file. If the slow query log is directed to the table ( --log-output=TABLE --slow-query-log), then the EXPLAIN is not captured. This is the same as with log-slow-verbosity=query_plan. |
| Comment by Sergei Petrunia [ 2013-11-12 ] |
|
Changed formatting based on the input from the mailing list. |
| Comment by Sergei Petrunia [ 2013-11-12 ] |
|
The code is in 10.0-base and 10.0 trees. |