<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-setup-objects-table">
      </a>
      29.12.2.4 The setup_objects Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045073749936">
  </a>
  <a class="indexterm" name="idm46045073748448">
  </a>
  <p>
   The
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   table controls
          whether the Performance Schema monitors particular objects.
          This table has a maximum size of 100 rows by default. To
          change the table size, modify the
   <a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_setup_objects_size">
    <code class="literal">
     performance_schema_setup_objects_size
    </code>
   </a>
   system variable at server startup.
  </p>
  <p>
   The initial
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   contents look like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa94365108"><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_objects<span class="token punctuation">;</span>
<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><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><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>
<span class="token output"><span class="token punctuation">|</span> OBJECT_TYPE <span class="token punctuation">|</span> OBJECT_SCHEMA      <span class="token punctuation">|</span> OBJECT_NAME <span class="token punctuation">|</span> ENABLED <span class="token punctuation">|</span> TIMED <span class="token punctuation">|</span></span>
<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><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><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>
<span class="token output"><span class="token punctuation">|</span> EVENT       <span class="token punctuation">|</span> mysql              <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> EVENT       <span class="token punctuation">|</span> performance_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> EVENT       <span class="token punctuation">|</span> information_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> EVENT       <span class="token punctuation">|</span> %                  <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> YES     <span class="token punctuation">|</span> YES   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> FUNCTION    <span class="token punctuation">|</span> mysql              <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> FUNCTION    <span class="token punctuation">|</span> performance_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> FUNCTION    <span class="token punctuation">|</span> information_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> FUNCTION    <span class="token punctuation">|</span> %                  <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> YES     <span class="token punctuation">|</span> YES   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> PROCEDURE   <span class="token punctuation">|</span> mysql              <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> PROCEDURE   <span class="token punctuation">|</span> performance_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> PROCEDURE   <span class="token punctuation">|</span> information_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> PROCEDURE   <span class="token punctuation">|</span> %                  <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> YES     <span class="token punctuation">|</span> YES   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TABLE       <span class="token punctuation">|</span> mysql              <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TABLE       <span class="token punctuation">|</span> performance_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TABLE       <span class="token punctuation">|</span> information_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TABLE       <span class="token punctuation">|</span> %                  <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> YES     <span class="token punctuation">|</span> YES   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TRIGGER     <span class="token punctuation">|</span> mysql              <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TRIGGER     <span class="token punctuation">|</span> performance_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TRIGGER     <span class="token punctuation">|</span> information_schema <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> NO      <span class="token punctuation">|</span> NO    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> TRIGGER     <span class="token punctuation">|</span> %                  <span class="token punctuation">|</span> %           <span class="token punctuation">|</span> YES     <span class="token punctuation">|</span> YES   <span class="token punctuation">|</span></span>
<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><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><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></code></pre>
  </div>
  <p>
   Modifications to the
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   table affect object
          monitoring immediately.
  </p>
  <p>
   For object types listed in
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   , the Performance
          Schema uses the table to how to monitor them. Object matching
          is based on the
   <code class="literal">
    OBJECT_SCHEMA
   </code>
   and
   <code class="literal">
    OBJECT_NAME
   </code>
   columns. Objects for which
          there is no match are not monitored.
  </p>
  <p>
   The effect of the default object configuration is to
          instrument all tables except those in the
   <code class="literal">
    mysql
   </code>
   ,
   <code class="literal">
    INFORMATION_SCHEMA
   </code>
   , and
   <code class="literal">
    performance_schema
   </code>
   databases. (Tables in
          the
   <code class="literal">
    INFORMATION_SCHEMA
   </code>
   database are not
          instrumented regardless of the contents of
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   ; the row for
   <code class="literal">
    information_schema.%
   </code>
   simply makes this
          default explicit.)
  </p>
  <p>
   When the Performance Schema checks for a match in
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   , it tries to find
          more specific matches first. For example, with a table
   <code class="literal">
    db1.t1
   </code>
   , it looks for a match for
   <code class="literal">
    'db1'
   </code>
   and
   <code class="literal">
    't1'
   </code>
   , then for
   <code class="literal">
    'db1'
   </code>
   and
   <code class="literal">
    '%'
   </code>
   , then for
   <code class="literal">
    '%'
   </code>
   and
   <code class="literal">
    '%'
   </code>
   . The order
          in which matching occurs matters because different matching
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   rows can have
          different
   <code class="literal">
    ENABLED
   </code>
   and
   <code class="literal">
    TIMED
   </code>
   values.
  </p>
  <p>
   Rows can be inserted into or deleted from
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   by users with the
   <a class="link" href="privileges-provided.html#priv_insert">
    <code class="literal">
     INSERT
    </code>
   </a>
   or
   <a class="link" href="privileges-provided.html#priv_delete">
    <code class="literal">
     DELETE
    </code>
   </a>
   privilege on the table.
          For existing rows, only the
   <code class="literal">
    ENABLED
   </code>
   and
   <code class="literal">
    TIMED
   </code>
   columns can be modified, by users
          with the
   <a class="link" href="privileges-provided.html#priv_update">
    <code class="literal">
     UPDATE
    </code>
   </a>
   privilege on
          the table.
  </p>
  <p>
   For more information about the role of the
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </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-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </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">
       OBJECT_TYPE
      </code>
     </p>
     <p>
      The type of object to instrument. The value is one of
      <code class="literal">
       'EVENT'
      </code>
      (Event Scheduler event),
      <code class="literal">
       'FUNCTION'
      </code>
      (stored function),
      <code class="literal">
       'PROCEDURE'
      </code>
      (stored procedure),
      <code class="literal">
       'TABLE'
      </code>
      (base table), or
      <code class="literal">
       'TRIGGER'
      </code>
      (trigger).
     </p>
     <p>
      <code class="literal">
       TABLE
      </code>
      filtering affects table I/O
              events (
      <code class="literal">
       wait/io/table/sql/handler
      </code>
      instrument) and table lock events
              (
      <code class="literal">
       wait/lock/table/sql/handler
      </code>
      instrument).
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       OBJECT_SCHEMA
      </code>
     </p>
     <p>
      The schema that contains the object. This should be a
              literal name, or
      <code class="literal">
       '%'
      </code>
      to mean
      <span class="quote">
       “
       <span class="quote">
        any
              schema.
       </span>
       ”
      </span>
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       OBJECT_NAME
      </code>
     </p>
     <p>
      The name of the instrumented object. This should be a
              literal name, or
      <code class="literal">
       '%'
      </code>
      to mean
      <span class="quote">
       “
       <span class="quote">
        any
              object.
       </span>
       ”
      </span>
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ENABLED
      </code>
     </p>
     <p>
      Whether events for the object are instrumented. The value
              is
      <code class="literal">
       YES
      </code>
      or
      <code class="literal">
       NO
      </code>
      . This
              column can be modified.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIMED
      </code>
     </p>
     <p>
      Whether events for the object are timed. This column can
              be modified.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   table has these
          indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Index on (
      <code class="literal">
       OBJECT_TYPE
      </code>
      ,
      <code class="literal">
       OBJECT_SCHEMA
      </code>
      ,
      <code class="literal">
       OBJECT_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 permitted for
          the
   <a class="link" href="performance-schema-setup-objects-table.html" title="29.12.2.4 The setup_objects Table">
    <code class="literal">
     setup_objects
    </code>
   </a>
   table. It
          removes the rows.
  </p>
 </div>
 <br/>
</div>
