<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="innodb-locking-transaction-model">
      </a>
      17.7 InnoDB Locking and Transaction Model
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="innodb-locking.html">
       17.7.1 InnoDB Locking
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-transaction-model.html">
       17.7.2 InnoDB Transaction Model
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-locks-set.html">
       17.7.3 Locks Set by Different SQL Statements in InnoDB
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-next-key-locking.html">
       17.7.4 Phantom Rows
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-deadlocks.html">
       17.7.5 Deadlocks in InnoDB
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-transaction-scheduling.html">
       17.7.6 Transaction Scheduling
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045164619200">
  </a>
  <a class="indexterm" name="idm46045164617808">
  </a>
  <a class="indexterm" name="idm46045164616416">
  </a>
  <a class="indexterm" name="idm46045164615408">
  </a>
  <p>
   To implement a large-scale, busy, or highly reliable database
    application, to port substantial code from a different database
    system, or to tune MySQL performance, it is important to understand
   <code class="literal">
    InnoDB
   </code>
   locking and the
   <code class="literal">
    InnoDB
   </code>
   transaction model.
  </p>
  <p>
   This section discusses several topics related to
   <code class="literal">
    InnoDB
   </code>
   locking and the
   <code class="literal">
    InnoDB
   </code>
   transaction model with which you should be familiar.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-locking.html" title="17.7.1 InnoDB Locking">
       Section 17.7.1, “InnoDB Locking”
      </a>
      describes lock types used by
      <code class="literal">
       InnoDB
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-transaction-model.html" title="17.7.2 InnoDB Transaction Model">
       Section 17.7.2, “InnoDB Transaction Model”
      </a>
      describes transaction
        isolation levels and the locking strategies used by each. It
        also discusses the use of
      <a class="link" href="server-system-variables.html#sysvar_autocommit">
       <code class="literal">
        autocommit
       </code>
      </a>
      , consistent
        non-locking reads, and locking reads.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-locks-set.html" title="17.7.3 Locks Set by Different SQL Statements in InnoDB">
       Section 17.7.3, “Locks Set by Different SQL Statements in InnoDB”
      </a>
      discusses specific types of
        locks set in
      <code class="literal">
       InnoDB
      </code>
      for various statements.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-next-key-locking.html" title="17.7.4 Phantom Rows">
       Section 17.7.4, “Phantom Rows”
      </a>
      describes how
      <code class="literal">
       InnoDB
      </code>
      uses next-key locking to avoid phantom
        rows.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-deadlocks.html" title="17.7.5 Deadlocks in InnoDB">
       Section 17.7.5, “Deadlocks in InnoDB”
      </a>
      provides a deadlock example,
        discusses deadlock detection, and provides tips for minimizing
        and handling deadlocks in
      <code class="literal">
       InnoDB
      </code>
      .
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
