<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="optimize-benchmarking">
      </a>
      10.13 Measuring Performance (Benchmarking)
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="select-benchmarking.html">
       10.13.1 Measuring the Speed of Expressions and Functions
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="custom-benchmarks.html">
       10.13.2 Using Your Own Benchmarks
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="monitoring-performance-schema.html">
       10.13.3 Measuring Performance with performance_schema
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045222096432">
  </a>
  <p>
   To measure performance, consider the following factors:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Whether you are measuring the speed of a single operation on a
          quiet system, or how a set of operations (a
      <span class="quote">
       “
       <span class="quote">
        workload
       </span>
       ”
      </span>
      ) works over a period of time. With
          simple tests, you usually test how changing one aspect (a
          configuration setting, the set of indexes on a table, the SQL
          clauses in a query) affects performance. Benchmarks are
          typically long-running and elaborate performance tests, where
          the results could dictate high-level choices such as hardware
          and storage configuration, or how soon to upgrade to a new
          MySQL version.
     </p>
    </li>
    <li class="listitem">
     <p>
      For benchmarking, sometimes you must simulate a heavy database
          workload to get an accurate picture.
     </p>
    </li>
    <li class="listitem">
     <p>
      Performance can vary depending on so many different factors
          that a difference of a few percentage points might not be a
          decisive victory. The results might shift the opposite way
          when you test in a different environment.
     </p>
    </li>
    <li class="listitem">
     <p>
      Certain MySQL features help or do not help performance
          depending on the workload. For completeness, always test
          performance with those features turned on and turned off. The
          most important feature to try with each workload is the
      <a class="link" href="innodb-adaptive-hash.html" title="17.5.3 Adaptive Hash Index">
       adaptive hash
          index
      </a>
      for
      <code class="literal">
       InnoDB
      </code>
      tables.
     </p>
    </li>
   </ul>
  </div>
  <p>
   This section progresses from simple and direct measurement
      techniques that a single developer can do, to more complicated
      ones that require additional expertise to perform and interpret
      the results.
  </p>
 </div>
 <br/>
</div>
