<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-profiling-table">
      </a>
      28.3.24 The INFORMATION_SCHEMA PROFILING Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045079091376">
  </a>
  <p>
   The
   <a class="link" href="information-schema-profiling-table.html" title="28.3.24 The INFORMATION_SCHEMA PROFILING Table">
    <code class="literal">
     PROFILING
    </code>
   </a>
   table provides
      statement profiling information. Its contents correspond to the
      information produced by the
   <a class="link" href="show-profile.html" title="15.7.7.32 SHOW PROFILE Statement">
    <code class="literal">
     SHOW
      PROFILE
    </code>
   </a>
   and
   <a class="link" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
    <code class="literal">
     SHOW PROFILES
    </code>
   </a>
   statements (see
   <a class="xref" href="show-profile.html" title="15.7.7.32 SHOW PROFILE Statement">
    Section 15.7.7.32, “SHOW PROFILE Statement”
   </a>
   ). The table is
      empty unless the
   <a class="link" href="server-system-variables.html#sysvar_profiling">
    <code class="literal">
     profiling
    </code>
   </a>
   session variable is set to 1.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    This table is deprecated; expect it to be removed in a future
        MySQL release. Use the
    <a class="link" href="performance-schema.html" title="Chapter 29 MySQL Performance Schema">
     Performance Schema
    </a>
    instead; see
    <a class="xref" href="performance-schema-query-profiling.html" title="29.19.1 Query Profiling Using Performance Schema">
     Section 29.19.1, “Query Profiling Using Performance Schema”
    </a>
    .
   </p>
  </div>
  <p>
   The
   <a class="link" href="information-schema-profiling-table.html" title="28.3.24 The INFORMATION_SCHEMA PROFILING Table">
    <code class="literal">
     PROFILING
    </code>
   </a>
   table has these
      columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       QUERY_ID
      </code>
     </p>
     <p>
      A numeric statement identifier.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SEQ
      </code>
     </p>
     <p>
      A sequence number indicating the display order for rows with
          the same
      <code class="literal">
       QUERY_ID
      </code>
      value.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STATE
      </code>
     </p>
     <p>
      The profiling state to which the row measurements apply.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DURATION
      </code>
     </p>
     <p>
      How long statement execution remained in the given state, in
          seconds.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CPU_USER
      </code>
      ,
      <code class="literal">
       CPU_SYSTEM
      </code>
     </p>
     <p>
      User and system CPU use, in seconds.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CONTEXT_VOLUNTARY
      </code>
      ,
      <code class="literal">
       CONTEXT_INVOLUNTARY
      </code>
     </p>
     <p>
      How many voluntary and involuntary context switches occurred.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       BLOCK_OPS_IN
      </code>
      ,
      <code class="literal">
       BLOCK_OPS_OUT
      </code>
     </p>
     <p>
      The number of block input and output operations.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MESSAGES_SENT
      </code>
      ,
      <code class="literal">
       MESSAGES_RECEIVED
      </code>
     </p>
     <p>
      The number of communication messages sent and received.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       PAGE_FAULTS_MAJOR
      </code>
      ,
      <code class="literal">
       PAGE_FAULTS_MINOR
      </code>
     </p>
     <p>
      The number of major and minor page faults.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SWAPS
      </code>
     </p>
     <p>
      How many swaps occurred.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SOURCE_FUNCTION
      </code>
      ,
      <code class="literal">
       SOURCE_FILE
      </code>
      , and
      <code class="literal">
       SOURCE_LINE
      </code>
     </p>
     <p>
      Information indicating where in the source code the profiled
          state executes.
     </p>
    </li>
   </ul>
  </div>
  <h4>
   <a name="idm46045079052144">
   </a>
   Notes
  </h4>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="information-schema-profiling-table.html" title="28.3.24 The INFORMATION_SCHEMA PROFILING Table">
       <code class="literal">
        PROFILING
       </code>
      </a>
      is a nonstandard
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      table.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Profiling information is also available from the
   <a class="link" href="show-profile.html" title="15.7.7.32 SHOW PROFILE Statement">
    <code class="literal">
     SHOW PROFILE
    </code>
   </a>
   and
   <a class="link" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
    <code class="literal">
     SHOW PROFILES
    </code>
   </a>
   statements. See
   <a class="xref" href="show-profile.html" title="15.7.7.32 SHOW PROFILE Statement">
    Section 15.7.7.32, “SHOW PROFILE Statement”
   </a>
   . For example, the following queries
      are equivalent:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa81750058"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token keyword">PROFILE</span> <span class="token keyword">FOR</span> <span class="token keyword">QUERY</span> <span class="token number">2</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> STATE<span class="token punctuation">,</span> <span class="token function">FORMAT</span><span class="token punctuation">(</span>DURATION<span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> DURATION
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>PROFILING
<span class="token keyword">WHERE</span> QUERY_ID <span class="token operator">=</span> <span class="token number">2</span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> SEQ<span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
