MySQL Internals Manual  /  Tracing the Optimizer  /  Nicely Displaying a Trace

8.15 Nicely Displaying a Trace

Looking at a trace in the mysql command-line client can be cumbersome (though the pager less command makes it better). An alternative can be to send the trace to a file:

SELECT TRACE INTO DUMPFILE <filename>
FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

Then pass this file to some JSON viewer. For example, the JsonView Firefox add-on shows objects in colours and allows object collapsing/expanding. Use INTO DUMPFILE and not INTO OUTFILE because the latter escapes newlines. Also, have the @@end_markers_in_json variable off: when it's on, the trace is more human readable but not JSON compliant.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.