Documentation Home
MySQL 9.1 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.4Mb
PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.1 Reference Manual  / ...  / Optimization  / Tracing the Optimizer  /  Displaying Traces in Other Applications

10.15.13 Displaying Traces in Other Applications

Examining a trace in themysql command-line client can be made less difficult using thepager less command (or your operating platform's equivalent). An alternative can be to send the trace to a file, similarly to what is shown here:

SELECT TRACE INTO DUMPFILEfileFROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

You can then pass this file to a JSON-aware text editor or other viewer, such as theJsonView add-on for Firefox and Chrome, which shows objects in color and allows objects to be expanded or collapsed.

INTO DUMPFILE is preferable toINTO OUTFILE for this purpose, since the latter escapes newlines. As noted previously, you should ensure thatend_markers_in_json isOFFwhen executing theSELECT INTO statement, so that the output is valid JSON.