<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="performance-schema-filtering-names">
      </a>
      29.4.9 Naming Instruments or Consumers for Filtering Operations
     </h3>
    </div>
   </div>
  </div>
  <p>
   Names given for filtering operations can be as specific or
        general as required. To indicate a single instrument or
        consumer, specify its name in full:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68537600"><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 string">'NO'</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/myisammrg/MYRG_INFO::mutex'</span><span class="token punctuation">;</span>

<span class="token keyword">UPDATE</span> performance_schema<span class="token punctuation">.</span>setup_consumers
<span class="token keyword">SET</span> ENABLED <span class="token operator">=</span> <span class="token string">'NO'</span>
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">=</span> <span class="token string">'events_waits_current'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   To specify a group of instruments or consumers, use a pattern
        that matches the group members:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa16168913"><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 string">'NO'</span>
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">LIKE</span> <span class="token string">'wait/synch/mutex/%'</span><span class="token punctuation">;</span>

<span class="token keyword">UPDATE</span> performance_schema<span class="token punctuation">.</span>setup_consumers
<span class="token keyword">SET</span> ENABLED <span class="token operator">=</span> <span class="token string">'NO'</span>
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">LIKE</span> <span class="token string">'%history%'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If you use a pattern, it should be chosen so that it matches all
        the items of interest and no others. For example, to select all
        file I/O instruments, it is better to use a pattern that
        includes the entire instrument name prefix:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa91031700"><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 punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">LIKE</span> <span class="token string">'wait/io/file/%'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   A pattern of
   <code class="literal">
    '%/file/%'
   </code>
   matches other
        instruments that have an element of
   <code class="literal">
    '/file/'
   </code>
   anywhere in the name. Even less suitable is the pattern
   <code class="literal">
    '%file%'
   </code>
   because it matches instruments with
   <code class="literal">
    'file'
   </code>
   anywhere in the name, such as
   <code class="literal">
    wait/synch/mutex/innodb/file_open_mutex
   </code>
   .
  </p>
  <p>
   To check which instrument or consumer names a pattern matches,
        perform a simple test:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa27683217"><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 keyword">NAME</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">'<em class="replaceable">pattern</em>'</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> <span class="token keyword">NAME</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>setup_consumers
<span class="token keyword">WHERE</span> <span class="token keyword">NAME</span> <span class="token operator">LIKE</span> <span class="token string">'<em class="replaceable">pattern</em>'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   For information about the types of names that are supported, see
   <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>
   .
  </p>
 </div>
 <br/>
</div>
