<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-setup-instruments-table">
      </a>
      29.12.2.3 The setup_instruments Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045073868752">
  </a>
  <a class="indexterm" name="idm46045073867264">
  </a>
  <p>
   The
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table lists
          classes of instrumented objects for which events can be
          collected:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa56722625"><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 prompt">mysql&gt;</span> <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\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
         NAME<span class="token punctuation">:</span> wait/synch/mutex/pfs/LOCK_pfs_share_list
      ENABLED<span class="token punctuation">:</span> NO
        TIMED<span class="token punctuation">:</span> NO
   PROPERTIES<span class="token punctuation">:</span> singleton
        FLAGS<span class="token punctuation">:</span> NULL
   VOLATILITY<span class="token punctuation">:</span> 1
DOCUMENTATION<span class="token punctuation">:</span> Components can provide their own performance_schema tables. 
This lock protects the list of such tables definitions.
...
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 410. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
         NAME<span class="token punctuation">:</span> stage/sql/executing
      ENABLED<span class="token punctuation">:</span> NO
        TIMED<span class="token punctuation">:</span> NO
   PROPERTIES<span class="token punctuation">:</span>
        FLAGS<span class="token punctuation">:</span> NULL
   VOLATILITY<span class="token punctuation">:</span> 0
DOCUMENTATION<span class="token punctuation">:</span> NULL
...
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 733. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
         NAME<span class="token punctuation">:</span> statement/abstract/Query
      ENABLED<span class="token punctuation">:</span> YES
        TIMED<span class="token punctuation">:</span> YES
   PROPERTIES<span class="token punctuation">:</span> mutable
        FLAGS<span class="token punctuation">:</span> NULL
   VOLATILITY<span class="token punctuation">:</span> 0
DOCUMENTATION<span class="token punctuation">:</span> SQL query just received from the network. 
At this point, the real statement type is unknown, the type 
will be refined after SQL parsing.
...
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 737. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
         NAME<span class="token punctuation">:</span> memory/performance_schema/mutex_instances
      ENABLED<span class="token punctuation">:</span> YES
        TIMED<span class="token punctuation">:</span> NULL
   PROPERTIES<span class="token punctuation">:</span> global_statistics
        FLAGS<span class="token punctuation">:</span>
   VOLATILITY<span class="token punctuation">:</span> 1
DOCUMENTATION<span class="token punctuation">:</span> Memory used for table performance_schema.mutex_instances
...
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 823. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
         NAME<span class="token punctuation">:</span> memory/sql/Prepared_statement<span class="token punctuation">:</span><span class="token punctuation">:</span>infrastructure
      ENABLED<span class="token punctuation">:</span> YES
        TIMED<span class="token punctuation">:</span> NULL
   PROPERTIES<span class="token punctuation">:</span> controlled_by_default
        FLAGS<span class="token punctuation">:</span> controlled
   VOLATILITY<span class="token punctuation">:</span> 0
DOCUMENTATION<span class="token punctuation">:</span> Map infrastructure for prepared statements per session.
...</span></code></pre>
  </div>
  <p>
   Each instrument added to the source code provides a row for
          the
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table, even
          when the instrumented code is not executed. When an instrument
          is enabled and executed, instrumented instances are created,
          which are visible in the
   <code class="literal">
    <em class="replaceable">
     <code>
      xxx
     </code>
    </em>
    _instances
   </code>
   tables, such as
   <a class="link" href="performance-schema-file-instances-table.html" title="29.12.3.2 The file_instances Table">
    <code class="literal">
     file_instances
    </code>
   </a>
   or
   <a class="link" href="performance-schema-rwlock-instances-table.html" title="29.12.3.4 The rwlock_instances Table">
    <code class="literal">
     rwlock_instances
    </code>
   </a>
   .
  </p>
  <p>
   Modifications to most
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   rows affect
          monitoring immediately. For some instruments, modifications
          are effective only at server startup; changing them at runtime
          has no effect. This affects primarily mutexes, conditions, and
          rwlocks in the server, although there may be other instruments
          for which this is true.
  </p>
  <p>
   For more information about the role of the
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table in event
          filtering, see
   <a class="xref" href="performance-schema-pre-filtering.html" title="29.4.3 Event Pre-Filtering">
    Section 29.4.3, “Event Pre-Filtering”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </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">
       NAME
      </code>
     </p>
     <p>
      The instrument name. Instrument names may have multiple
              parts and form a hierarchy, as discussed in
      <a class="xref" href="performance-schema-instrument-naming.html" title="29.6 Performance Schema Instrument Naming Conventions">
       Section 29.6, “Performance Schema Instrument Naming Conventions”
      </a>
      .
              Events produced from execution of an instrument have an
      <code class="literal">
       EVENT_NAME
      </code>
      value that is taken from the
              instrument
      <code class="literal">
       NAME
      </code>
      value. (Events do not
              really have a
      <span class="quote">
       “
       <span class="quote">
        name,
       </span>
       ”
      </span>
      but this provides a way
              to associate events with instruments.)
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ENABLED
      </code>
     </p>
     <p>
      Whether the instrument is enabled. The value is
      <code class="literal">
       YES
      </code>
      or
      <code class="literal">
       NO
      </code>
      . A
              disabled instrument produces no events. This column can be
              modified, although setting
      <code class="literal">
       ENABLED
      </code>
      has
              no effect for instruments that have already been created.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIMED
      </code>
     </p>
     <p>
      Whether the instrument is timed. The value is
      <code class="literal">
       YES
      </code>
      ,
      <code class="literal">
       NO
      </code>
      , or
      <code class="literal">
       NULL
      </code>
      . This column can be modified,
              although setting
      <code class="literal">
       TIMED
      </code>
      has no effect
              for instruments that have already been created.
     </p>
     <p>
      A
      <code class="literal">
       TIMED
      </code>
      value of
      <code class="literal">
       NULL
      </code>
      indicates that the instrument does
              not support timing. For example, memory operations are not
              timed, so their
      <code class="literal">
       TIMED
      </code>
      column is
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      Setting
      <code class="literal">
       TIMED
      </code>
      to
      <code class="literal">
       NULL
      </code>
      for an instrument that supports
              timing has no effect, as does setting
      <code class="literal">
       TIMED
      </code>
      to non-
      <code class="literal">
       NULL
      </code>
      for an instrument that does not support timing.
     </p>
     <p>
      If an enabled instrument is not timed, the instrument code
              is enabled, but the timer is not. Events produced by the
              instrument have
      <code class="literal">
       NULL
      </code>
      for the
      <code class="literal">
       TIMER_START
      </code>
      ,
      <code class="literal">
       TIMER_END
      </code>
      , and
      <code class="literal">
       TIMER_WAIT
      </code>
      timer values. This in turn
              causes those values to be ignored when calculating the
              sum, minimum, maximum, and average time values in summary
              tables.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       PROPERTIES
      </code>
     </p>
     <p>
      The instrument properties. This column uses the
      <a class="link" href="set.html" title="13.3.6 The SET Type">
       <code class="literal">
        SET
       </code>
      </a>
      data type, so multiple
              flags from the following list can be set per instrument:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         <code class="literal">
          controlled_by_default
         </code>
         : memory is
                  collected by default for this instrument.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          global_statistics
         </code>
         : The instrument
                  produces only global summaries. Summaries for finer
                  levels are unavailable, such as per thread, account,
                  user, or host. For example, most memory instruments
                  produce only global summaries.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          mutable
         </code>
         : The instrument can
         <span class="quote">
          “
          <span class="quote">
           mutate
          </span>
          ”
         </span>
         into a more specific one. This
                  property applies only to statement instruments.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          progress
         </code>
         : The instrument is capable
                  of reporting progress data. This property applies only
                  to stage instruments.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          singleton
         </code>
         : The instrument has a
                  single instance. For example, most global mutex locks
                  in the server are singletons, so the corresponding
                  instruments are as well.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          user
         </code>
         : The instrument is directly
                  related to user workload (as opposed to system
                  workload). One such instrument is
         <code class="literal">
          wait/io/socket/sql/client_connection
         </code>
         .
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FLAGS
      </code>
     </p>
     <p>
      Whether the instrument's memory is controlled.
     </p>
     <p>
      This flag is supported for non-global memory instruments,
              only, and can be set or unset. For example:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa97589916"><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">SQL</span><span class="token operator">&gt;</span> <span class="token keyword">UPDATE</span> PERFORMANCE_SCHEMA<span class="token punctuation">.</span>SETUP_INTRUMENTS <span class="token keyword">SET</span> FLAGS<span class="token operator">=</span><span class="token string">"controlled"</span> <span class="token keyword">WHERE</span> <span class="token keyword">NAME</span><span class="token operator">=</span><span class="token string">'memory/sql/NET::buff'</span><span class="token punctuation">;</span></code></pre>
     </div>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       Attempting to set
       <code class="literal">
        FLAGS = controlled
       </code>
       on non-memory instruments, or on global memory
                instruments, fails silently.
      </p>
     </div>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       VOLATILITY
      </code>
     </p>
     <p>
      The instrument volatility. Volatility values range from
              low to high. The values correspond to the
      <code class="literal">
       PSI_VOLATILITY_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      constants defined in the
      <code class="filename">
       mysql/psi/psi_base.h
      </code>
      header file:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-c"><div class="docs-select-all right" id="sa41440201"><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-c"><span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_UNKNOWN 0</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_PERMANENT 1</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_PROVISIONING 2</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_DDL 3</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_CACHE 4</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_SESSION 5</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_TRANSACTION 6</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_QUERY 7</span>
<span class="token macro property">#<span class="token directive keyword">define</span> PSI_VOLATILITY_INTRA_QUERY 8</span></code></pre>
     </div>
     <p>
      The
      <code class="literal">
       VOLATILITY
      </code>
      column is purely
              informational, to provide users (and the Performance
              Schema code) some hint about the instrument runtime
              behavior.
     </p>
     <p>
      Instruments with a low volatility index (PERMANENT = 1)
              are created once at server startup, and never destroyed or
              re-created during normal server operation. They are
              destroyed only during server shutdown.
     </p>
     <p>
      For example, the
      <code class="literal">
       wait/synch/mutex/pfs/LOCK_pfs_share_list
      </code>
      mutex is defined with a volatility of 1, which means it is
              created once. Possible overhead from the instrumentation
              itself (namely, mutex initialization) has no effect for
              this instrument then. Runtime overhead occurs only when
              locking or unlocking the mutex.
     </p>
     <p>
      Instruments with a higher volatility index (for example,
              SESSION = 5) are created and destroyed for every user
              session. For example, the
      <code class="literal">
       wait/synch/mutex/sql/THD::LOCK_query_plan
      </code>
      mutex is created each time a session connects, and
              destroyed when the session disconnects.
     </p>
     <p>
      This mutex is more sensitive to Performance Schema
              overhead, because overhead comes not only from the lock
              and unlock instrumentation, but also from mutex create and
              destroy instrumentation, which is executed more often.
     </p>
     <p>
      Another aspect of volatility concerns whether and when an
              update to the
      <code class="literal">
       ENABLED
      </code>
      column actually
              has some effect:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         An update to
         <code class="literal">
          ENABLED
         </code>
         affects
                  instrumented objects created subsequently, but has no
                  effect on instruments already created.
        </p>
       </li>
       <li class="listitem">
        <p>
         Instruments that are more
         <span class="quote">
          “
          <span class="quote">
           volatile
          </span>
          ”
         </span>
         use
                  new settings from the
         <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
          <code class="literal">
           setup_instruments
          </code>
         </a>
         table
                  sooner.
        </p>
       </li>
      </ul>
     </div>
     <p>
      For example, this statement does not affect the
      <code class="literal">
       LOCK_query_plan
      </code>
      mutex for existing
              sessions, but does have an effect on new sessions created
              subsequent to the update:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa79379146"><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">UPDATE</span> performance_schema<span class="token punctuation">.</span>setup_instruments
<span class="token keyword">SET</span> ENABLED<span class="token operator">=</span><span class="token keyword"><em class="replaceable">value</em></span>
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">=</span> <span class="token string">'wait/synch/mutex/sql/THD::LOCK_query_plan'</span><span class="token punctuation">;</span></code></pre>
     </div>
     <p>
      This statement actually has no effect at all:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96956878"><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">UPDATE</span> performance_schema<span class="token punctuation">.</span>setup_instruments
<span class="token keyword">SET</span> ENABLED<span class="token operator">=</span><span class="token keyword"><em class="replaceable">value</em></span>
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">=</span> <span class="token string">'wait/synch/mutex/pfs/LOCK_pfs_share_list'</span><span class="token punctuation">;</span></code></pre>
     </div>
     <p>
      This mutex is permanent, and was created already before
              the update is executed. The mutex is never created again,
              so the
      <code class="literal">
       ENABLED
      </code>
      value in
      <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
       <code class="literal">
        setup_instruments
       </code>
      </a>
      is never
              used. To enable or disable this mutex, use the
      <a class="link" href="performance-schema-mutex-instances-table.html" title="29.12.3.3 The mutex_instances Table">
       <code class="literal">
        mutex_instances
       </code>
      </a>
      table
              instead.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DOCUMENTATION
      </code>
     </p>
     <p>
      A string describing the instrument purpose. The value is
      <code class="literal">
       NULL
      </code>
      if no description is available.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table has
          these indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Primary key on (
      <code class="literal">
       NAME
      </code>
      )
     </p>
    </li>
   </ul>
  </div>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is not permitted
          for the
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table.
  </p>
  <a class="indexterm" name="idm46045073767888">
  </a>
  <a class="indexterm" name="idm46045073766400">
  </a>
  <p>
   To assist monitoring and troubleshooting, the Performance
          Schema instrumentation is used to export names of instrumented
          threads to the operating system. This enables utilities that
          display thread names, such as debuggers and the Unix
   <span class="command">
    <strong>
     ps
    </strong>
   </span>
   command, to display distinct
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   thread names rather than
   <span class="quote">
    “
    <span class="quote">
     mysqld
    </span>
    ”
   </span>
   . This feature is supported only on
          Linux, macOS, and Windows.
  </p>
  <p>
   Suppose that
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   is running on a system
          that has a version of
   <span class="command">
    <strong>
     ps
    </strong>
   </span>
   that supports this
          invocation syntax:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa35043662"><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-terminal">ps <span class="token property">-C</span> mysqld H <span class="token property">-o</span> <span class="token atrule">"pid tid cmd comm"</span></code></pre>
  </div>
  <p>
   Without export of thread names to the operating system, the
          command displays output like this, where most
   <code class="literal">
    COMMAND
   </code>
   values are
   <code class="literal">
    mysqld
   </code>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa41864560"><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-none">  PID   TID CMD                         COMMAND
 1377  1377 /usr/sbin/mysqld            mysqld
 1377  1528 /usr/sbin/mysqld            mysqld
 1377  1529 /usr/sbin/mysqld            mysqld
 1377  1530 /usr/sbin/mysqld            mysqld
 1377  1531 /usr/sbin/mysqld            mysqld
 1377  1534 /usr/sbin/mysqld            mysqld
 1377  1535 /usr/sbin/mysqld            mysqld
 1377  1588 /usr/sbin/mysqld            xpl_worker1
 1377  1589 /usr/sbin/mysqld            xpl_worker0
 1377  1590 /usr/sbin/mysqld            mysqld
 1377  1594 /usr/sbin/mysqld            mysqld
 1377  1595 /usr/sbin/mysqld            mysqld</code></pre>
  </div>
  <p>
   With export of thread names to the operating system, the
          output looks like this, with threads having a name similar to
          their instrument name:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa37107104"><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-none">  PID   TID CMD                         COMMAND
27668 27668 /usr/sbin/mysqld            mysqld
27668 27671 /usr/sbin/mysqld            ib_io_ibuf
27668 27672 /usr/sbin/mysqld            ib_io_log
27668 27673 /usr/sbin/mysqld            ib_io_rd-1
27668 27674 /usr/sbin/mysqld            ib_io_rd-2
27668 27677 /usr/sbin/mysqld            ib_io_wr-1
27668 27678 /usr/sbin/mysqld            ib_io_wr-2
27668 27699 /usr/sbin/mysqld            xpl_worker-2
27668 27700 /usr/sbin/mysqld            xpl_accept-1
27668 27710 /usr/sbin/mysqld            evt_sched
27668 27711 /usr/sbin/mysqld            sig_handler
27668 27933 /usr/sbin/mysqld            connection</code></pre>
  </div>
  <p>
   Different thread instances within the same class are numbered
          to provide distinct names where that is feasible. Due to
          constraints on name lengths with respect to potentially large
          numbers of connections, connections are named simply
   <code class="literal">
    connection
   </code>
   .
  </p>
 </div>
 <br/>
</div>
