<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="optimization-indexes">
      </a>
      10.3 Optimization and Indexes
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="mysql-indexes.html">
       10.3.1 How MySQL Uses Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="primary-key-optimization.html">
       10.3.2 Primary Key Optimization
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="spatial-index-optimization.html">
       10.3.3 SPATIAL Index Optimization
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="foreign-key-optimization.html">
       10.3.4 Foreign Key Optimization
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="column-indexes.html">
       10.3.5 Column Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="multiple-column-indexes.html">
       10.3.6 Multiple-Column Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="verifying-index-usage.html">
       10.3.7 Verifying Index Usage
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="index-statistics.html">
       10.3.8 InnoDB and MyISAM Index Statistics Collection
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="index-btree-hash.html">
       10.3.9 Comparison of B-Tree and Hash Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="index-extensions.html">
       10.3.10 Use of Index Extensions
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="generated-column-index-optimizations.html">
       10.3.11 Optimizer Use of Generated Column Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="invisible-indexes.html">
       10.3.12 Invisible Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="descending-indexes.html">
       10.3.13 Descending Indexes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="timestamp-lookups.html">
       10.3.14 Indexed Lookups from TIMESTAMP Columns
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045227577968">
  </a>
  <p>
   The best way to improve the performance of
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   operations is to create
      indexes on one or more of the columns that are tested in the
      query. The index entries act like pointers to the table rows,
      allowing the query to quickly determine which rows match a
      condition in the
   <code class="literal">
    WHERE
   </code>
   clause, and retrieve the
      other column values for those rows. All MySQL data types can be
      indexed.
  </p>
  <p>
   Although it can be tempting to create an indexes for every
      possible column used in a query, unnecessary indexes waste space
      and waste time for MySQL to determine which indexes to use.
      Indexes also add to the cost of inserts, updates, and deletes
      because each index must be updated. You must find the right
      balance to achieve fast queries using the optimal set of indexes.
  </p>
 </div>
 <br/>
</div>
