<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="thread-pool-elements">
      </a>
      7.6.3.1 Thread Pool Elements
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045256857264">
  </a>
  <p>
   MySQL Enterprise Thread Pool comprises these elements:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      A plugin library file implements a plugin for the thread
            pool code as well as several associated monitoring tables
            that provide information about thread pool operation:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         In MySQL 8.4, the monitoring tables are
                Performance Schema tables; see
         <a class="xref" href="performance-schema-thread-pool-tables.html" title="29.12.16 Performance Schema Thread Pool Tables">
          Section 29.12.16, “Performance Schema Thread Pool Tables”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         In older versions of MySQL, the monitoring tables were
         <code class="literal">
          INFORMATION_SCHEMA
         </code>
         tables (see
         <a class="xref" href="thread-pool-information-schema-tables.html" title="28.5 INFORMATION_SCHEMA Thread Pool Tables">
          Section 28.5, “INFORMATION_SCHEMA Thread Pool Tables”
         </a>
         ).
                The
         <code class="literal">
          INFORMATION_SCHEMA
         </code>
         tables are
                deprecated; expect them to be removed in a future
                version of MySQL. Applications should transition away
                from the
         <code class="literal">
          INFORMATION_SCHEMA
         </code>
         tables to
                the Performance Schema tables. For example, if an
                application uses this query:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa36939135"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>TP_THREAD_STATE<span class="token punctuation">;</span></code></pre>
        </div>
        <p>
         The application should use this query instead:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa66787753"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>tp_thread_state<span class="token punctuation">;</span></code></pre>
        </div>
       </li>
      </ul>
     </div>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       If you do not load all the monitoring tables, some or all
              MySQL Enterprise Monitor thread pool graphs may be empty.
      </p>
     </div>
     <p>
      For a detailed description of how the thread pool works, see
      <a class="xref" href="thread-pool-operation.html" title="7.6.3.3 Thread Pool Operation">
       Section 7.6.3.3, “Thread Pool Operation”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Several system variables are related to the thread pool. The
      <a class="link" href="server-system-variables.html#sysvar_thread_handling">
       <code class="literal">
        thread_handling
       </code>
      </a>
      system
            variable has a value of
      <code class="literal">
       loaded-dynamically
      </code>
      when the server
            successfully loads the thread pool plugin.
     </p>
     <p>
      The other related system variables are implemented by the
            thread pool plugin and are not available unless it is
            enabled. For information about using these variables, see
      <a class="xref" href="thread-pool-operation.html" title="7.6.3.3 Thread Pool Operation">
       Section 7.6.3.3, “Thread Pool Operation”
      </a>
      , and
      <a class="xref" href="thread-pool-tuning.html" title="7.6.3.4 Thread Pool Tuning">
       Section 7.6.3.4, “Thread Pool Tuning”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The Performance Schema has instruments that expose
            information about the thread pool and may be used to
            investigate operational performance. To identify them, use
            this query:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa63151090"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>setup_instruments
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">LIKE</span> <span class="token string">'%thread_pool%'</span><span class="token punctuation">;</span></code></pre>
     </div>
     <p>
      For more information, see
      <a class="xref" href="performance-schema.html" title="Chapter 29 MySQL Performance Schema">
       Chapter 29,
       <i>
        MySQL Performance Schema
       </i>
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
