Documentation Home
MySQL 9.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.2Mb
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.4 Reference Manual  / ...  / INFORMATION_SCHEMA Tables  / INFORMATION_SCHEMA General Tables  /  The INFORMATION_SCHEMA OPTIMIZER_TRACE Table

28.3.24 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table

TheOPTIMIZER_TRACE table provides information produced by the optimizer tracing capability for traced statements. To enable tracking, use theoptimizer_trace system variable. For details, seeSection 10.15, “Tracing the Optimizer”.

TheOPTIMIZER_TRACE table has these columns:

  • QUERY

    The text of the traced statement.

  • TRACE

    The trace, inJSON format.

  • MISSING_BYTES_BEYOND_MAX_MEM_SIZE

    Each remembered trace is a string that is extended as optimization progresses and appends data to it. Theoptimizer_trace_max_mem_size variable sets a limit on the total amount of memory used by all currently remembered traces. If this limit is reached, the current trace is not extended (and thus is incomplete), and theMISSING_BYTES_BEYOND_MAX_MEM_SIZE column shows the number of bytes missing from the trace.

  • INSUFFICIENT_PRIVILEGES

    If a traced query uses views or stored routines that haveSQL SECURITY with a value ofDEFINER, it may be that a user other than the definer is denied from seeing the trace of the query. In that case, the trace is shown as empty andINSUFFICIENT_PRIVILEGES has a value of 1. Otherwise, the value is 0.