<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="performance-schema-build-configuration">
      </a>
      29.2 Performance Schema Build Configuration
     </h2>
    </div>
   </div>
  </div>
  <p>
   The Performance Schema is mandatory and always compiled in. It is
      possible to exclude certain parts of the Performance Schema
      instrumentation. For example, to exclude stage and statement
      instrumentation, do this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa33568553"><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"><span class="token prompt">$&gt; </span><span class="token command">cmake</span> <span class="token punctuation">.</span> \
        <span class="token constant">-DDISABLE_PSI_STAGE</span><span class="token attr-value"><span class="token punctuation">=</span>1</span> \
        <span class="token constant">-DDISABLE_PSI_STATEMENT</span><span class="token attr-value"><span class="token punctuation">=</span>1</span></code></pre>
  </div>
  <p>
   For more information, see the descriptions of the
   <code class="literal">
    DISABLE_PSI_
    <em class="replaceable">
     <code>
      XXX
     </code>
    </em>
   </code>
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   options in
   <a class="xref" href="source-configuration-options.html" title="2.8.7 MySQL Source-Configuration Options">
    Section 2.8.7, “MySQL Source-Configuration Options”
   </a>
   .
  </p>
  <p>
   If you install MySQL over a previous installation that was
      configured without the Performance Schema (or with an older
      version of the Performance Schema that has missing or out-of-date
      tables). One indication of this issue is the presence of messages
      such as the following in the error log:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa56732322"><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">[ERROR] Native table 'performance_schema'.'events_waits_history'
has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_history_long'
has the wrong structure
...</code></pre>
  </div>
  <p>
   To correct that problem, perform the MySQL upgrade procedure. See
   <a class="xref" href="upgrading.html" title="Chapter 3 Upgrading MySQL">
    Chapter 3,
    <i>
     Upgrading MySQL
    </i>
   </a>
   .
  </p>
  <p>
   Because the Performance Schema is configured into the server at
      build time, a row for
   <a class="link" href="performance-schema.html" title="Chapter 29 MySQL Performance Schema">
    <code class="literal">
     PERFORMANCE_SCHEMA
    </code>
   </a>
   appears in the
      output from
   <a class="link" href="show-engines.html" title="15.7.7.17 SHOW ENGINES Statement">
    <code class="literal">
     SHOW ENGINES
    </code>
   </a>
   . This
      means that the Performance Schema is available, not that it is
      enabled. To enable it, you must do so at server startup, as
      described in the next section.
  </p>
 </div>
 <br/>
</div>
