<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="primary-key-optimization">
      </a>
      10.3.2 Primary Key Optimization
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045227511536">
  </a>
  <p>
   The primary key for a table represents the column or set of
        columns that you use in your most vital queries. It has an
        associated index, for fast query performance. Query performance
        benefits from the
   <code class="literal">
    NOT NULL
   </code>
   optimization,
        because it cannot include any
   <code class="literal">
    NULL
   </code>
   values.
        With the
   <code class="literal">
    InnoDB
   </code>
   storage engine, the table
        data is physically organized to do ultra-fast lookups and sorts
        based on the primary key column or columns.
  </p>
  <p>
   If your table is big and important, but does not have an obvious
        column or set of columns to use as a primary key, you might
        create a separate column with auto-increment values to use as
        the primary key. These unique IDs can serve as pointers to
        corresponding rows in other tables when you join tables using
        foreign keys.
  </p>
 </div>
 <br/>
</div>
