<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="innodb-information-schema-examples">
      </a>
      17.15.2.1 Using InnoDB Transaction and Locking Information
     </h4>
    </div>
   </div>
  </div>
  <p>
   This section describes the use of locking information as exposed
        by the Performance Schema
   <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
    <code class="literal">
     data_locks
    </code>
   </a>
   and
   <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
    <code class="literal">
     data_lock_waits
    </code>
   </a>
   tables.
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="innodb-information-schema-examples-simple-blocking">
       </a>
       Identifying Blocking Transactions
      </h5>
     </div>
    </div>
   </div>
   <p>
    It is sometimes helpful to identify which transaction blocks
          another. The tables that contain information about
    <code class="literal">
     InnoDB
    </code>
    transactions and data locks enable
          you to determine which transaction is waiting for another, and
          which resource is being requested. (For descriptions of these
          tables, see
    <a class="xref" href="innodb-information-schema-transactions.html" title="17.15.2 InnoDB INFORMATION_SCHEMA Transaction and Locking Information">
     Section 17.15.2, “InnoDB INFORMATION_SCHEMA Transaction and Locking Information”
    </a>
    .)
   </p>
   <p>
    Suppose that three sessions are running concurrently. Each
          session corresponds to a MySQL thread, and executes one
          transaction after another. Consider the state of the system
          when these sessions have issued the following statements, but
          none has yet committed its transaction:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Session A:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa57025620"><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-sql"><span class="token keyword">BEGIN</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> a <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token function">SLEEP</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Session B:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47984687"><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-sql"><span class="token keyword">SELECT</span> b <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Session C:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28718849"><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-sql"><span class="token keyword">SELECT</span> c <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span></code></pre>
      </div>
     </li>
    </ul>
   </div>
   <p>
    In this scenario, use the following query to see which
          transactions are waiting and which transactions are blocking
          them:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa59935054"><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-sql"><span class="token keyword">SELECT</span>
  r<span class="token punctuation">.</span>trx_id waiting_trx_id<span class="token punctuation">,</span>
  r<span class="token punctuation">.</span>trx_mysql_thread_id waiting_thread<span class="token punctuation">,</span>
  r<span class="token punctuation">.</span>trx_query waiting_query<span class="token punctuation">,</span>
  b<span class="token punctuation">.</span>trx_id blocking_trx_id<span class="token punctuation">,</span>
  b<span class="token punctuation">.</span>trx_mysql_thread_id blocking_thread<span class="token punctuation">,</span>
  b<span class="token punctuation">.</span>trx_query blocking_query
<span class="token keyword">FROM</span>       performance_schema<span class="token punctuation">.</span>data_lock_waits w
<span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> information_schema<span class="token punctuation">.</span>innodb_trx b
  <span class="token keyword">ON</span> b<span class="token punctuation">.</span>trx_id <span class="token operator">=</span> w<span class="token punctuation">.</span>blocking_engine_transaction_id
<span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> information_schema<span class="token punctuation">.</span>innodb_trx r
  <span class="token keyword">ON</span> r<span class="token punctuation">.</span>trx_id <span class="token operator">=</span> w<span class="token punctuation">.</span>requesting_engine_transaction_id<span class="token punctuation">;</span></code></pre>
   </div>
   <p>
    Or, more simply, use the
    <code class="literal">
     sys
    </code>
    schema
    <a class="link" href="sys-innodb-lock-waits.html" title="30.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views">
     <code class="literal">
      innodb_lock_waits
     </code>
    </a>
    view:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21281945"><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-sql"><span class="token keyword">SELECT</span>
  waiting_trx_id<span class="token punctuation">,</span>
  waiting_pid<span class="token punctuation">,</span>
  waiting_query<span class="token punctuation">,</span>
  blocking_trx_id<span class="token punctuation">,</span>
  blocking_pid<span class="token punctuation">,</span>
  blocking_query
<span class="token keyword">FROM</span> sys<span class="token punctuation">.</span>innodb_lock_waits<span class="token punctuation">;</span></code></pre>
   </div>
   <p>
    If a NULL value is reported for the blocking query, see
    <a class="xref" href="innodb-information-schema-examples.html#innodb-information-schema-examples-null-blocking-query" title="Identifying a Blocking Query After the Issuing Session Becomes Idle">
     Identifying a Blocking Query After the Issuing Session Becomes Idle
    </a>
    .
   </p>
   <div class="informaltable">
    <table summary="The result set of a query against the perormance_schema.data_lock_waits and INFORMATION_SCHEMA.INNODB_TRX tables, shown in the preceding text, indicating which InnoDB threads are waiting for which other threads.">
     <colgroup>
      <col style="width: 9%"/>
      <col style="width: 9%"/>
      <col style="width: 33%"/>
      <col style="width: 10%"/>
      <col style="width: 10%"/>
      <col style="width: 33%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        waiting trx id
       </th>
       <th scope="col">
        waiting thread
       </th>
       <th scope="col">
        waiting query
       </th>
       <th scope="col">
        blocking trx id
       </th>
       <th scope="col">
        blocking thread
       </th>
       <th scope="col">
        blocking query
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         A4
        </code>
       </th>
       <td>
        <code class="literal">
         6
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT b FROM t FOR UPDATE
        </code>
       </td>
       <td>
        <code class="literal">
         A3
        </code>
       </td>
       <td>
        <code class="literal">
         5
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT SLEEP(100)
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5
        </code>
       </th>
       <td>
        <code class="literal">
         7
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT c FROM t FOR UPDATE
        </code>
       </td>
       <td>
        <code class="literal">
         A3
        </code>
       </td>
       <td>
        <code class="literal">
         5
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT SLEEP(100)
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5
        </code>
       </th>
       <td>
        <code class="literal">
         7
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT c FROM t FOR UPDATE
        </code>
       </td>
       <td>
        <code class="literal">
         A4
        </code>
       </td>
       <td>
        <code class="literal">
         6
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT b FROM t FOR UPDATE
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    In the preceding table, you can identify sessions by the
    <span class="quote">
     “
     <span class="quote">
      waiting query
     </span>
     ”
    </span>
    or
    <span class="quote">
     “
     <span class="quote">
      blocking query
     </span>
     ”
    </span>
    columns. As you can see:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Session B (trx id
       <code class="literal">
        A4
       </code>
       , thread
       <code class="literal">
        6
       </code>
       ) and Session C (trx id
       <code class="literal">
        A5
       </code>
       , thread
       <code class="literal">
        7
       </code>
       ) are
              both waiting for Session A (trx id
       <code class="literal">
        A3
       </code>
       ,
              thread
       <code class="literal">
        5
       </code>
       ).
      </p>
     </li>
     <li class="listitem">
      <p>
       Session C is waiting for Session B as well as Session A.
      </p>
     </li>
    </ul>
   </div>
   <p>
    You can see the underlying data in the
    <code class="literal">
     INFORMATION_SCHEMA
    </code>
    <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
     <code class="literal">
      INNODB_TRX
     </code>
    </a>
    table and Performance
          Schema
    <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
     <code class="literal">
      data_locks
     </code>
    </a>
    and
    <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
     <code class="literal">
      data_lock_waits
     </code>
    </a>
    tables.
   </p>
   <p>
    The following table shows some sample contents of the
    <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
     <code class="literal">
      INNODB_TRX
     </code>
    </a>
    table.
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-examples-simple-blocking-trx">
    </a>
    <table summary="Sample data from the INFORMATION_SCHEMA.INNODB_TRX table, showing the typical types of entries for each column.">
     <colgroup>
      <col style="width: 10%"/>
      <col style="width: 13%"/>
      <col style="width: 36%"/>
      <col style="width: 30%"/>
      <col style="width: 36%"/>
      <col style="width: 19%"/>
      <col style="width: 23%"/>
      <col style="width: 45%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        trx id
       </th>
       <th scope="col">
        trx state
       </th>
       <th scope="col">
        trx started
       </th>
       <th scope="col">
        trx requested lock id
       </th>
       <th scope="col">
        trx wait started
       </th>
       <th scope="col">
        trx weight
       </th>
       <th scope="col">
        trx mysql thread id
       </th>
       <th scope="col">
        trx query
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         A3
        </code>
       </th>
       <td>
        <code class="literal">
         RUN­NING
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 16:44:54
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         2
        </code>
       </td>
       <td>
        <code class="literal">
         5
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT SLEEP(100)
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A4
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 16:45:09
        </code>
       </td>
       <td>
        <code class="literal">
         A4:1:3:2
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 16:45:09
        </code>
       </td>
       <td>
        <code class="literal">
         2
        </code>
       </td>
       <td>
        <code class="literal">
         6
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT b FROM t FOR UPDATE
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 16:45:14
        </code>
       </td>
       <td>
        <code class="literal">
         A5:1:3:2
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 16:45:14
        </code>
       </td>
       <td>
        <code class="literal">
         2
        </code>
       </td>
       <td>
        <code class="literal">
         7
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT c FROM t FOR UPDATE
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    The following table shows some sample contents of the
    <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
     <code class="literal">
      data_locks
     </code>
    </a>
    table.
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-examples-simple-blocking-locks">
    </a>
    <table summary="Sample data from the Performance Schema data_locks table, showing the typical types of entries for each column.">
     <colgroup>
      <col style="width: 26%"/>
      <col style="width: 13%"/>
      <col style="width: 14%"/>
      <col style="width: 21%"/>
      <col style="width: 16%"/>
      <col style="width: 15%"/>
      <col style="width: 29%"/>
      <col style="width: 20%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        lock id
       </th>
       <th scope="col">
        lock trx id
       </th>
       <th scope="col">
        lock mode
       </th>
       <th scope="col">
        lock type
       </th>
       <th scope="col">
        lock schema
       </th>
       <th scope="col">
        lock table
       </th>
       <th scope="col">
        lock index
       </th>
       <th scope="col">
        lock data
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         A3:1:3:2
        </code>
       </th>
       <td>
        <code class="literal">
         A3
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         0x0200
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A4:1:3:2
        </code>
       </th>
       <td>
        <code class="literal">
         A4
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         0x0200
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5:1:3:2
        </code>
       </th>
       <td>
        <code class="literal">
         A5
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         0x0200
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    The following table shows some sample contents of the
    <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
     <code class="literal">
      data_lock_waits
     </code>
    </a>
    table.
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-examples-simple-blocking-waits">
    </a>
    <table summary="Sample data from the Performance Schema data_lock_waits table, showing the typical types of entries for each column.">
     <colgroup>
      <col style="width: 10%"/>
      <col style="width: 15%"/>
      <col style="width: 10%"/>
      <col style="width: 15%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        requesting trx id
       </th>
       <th scope="col">
        requested lock id
       </th>
       <th scope="col">
        blocking trx id
       </th>
       <th scope="col">
        blocking lock id
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         A4
        </code>
       </th>
       <td>
        <code class="literal">
         A4:1:3:2
        </code>
       </td>
       <td>
        <code class="literal">
         A3
        </code>
       </td>
       <td>
        <code class="literal">
         A3:1:3:2
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5
        </code>
       </th>
       <td>
        <code class="literal">
         A5:1:3:2
        </code>
       </td>
       <td>
        <code class="literal">
         A3
        </code>
       </td>
       <td>
        <code class="literal">
         A3:1:3:2
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         A5
        </code>
       </th>
       <td>
        <code class="literal">
         A5:1:3:2
        </code>
       </td>
       <td>
        <code class="literal">
         A4
        </code>
       </td>
       <td>
        <code class="literal">
         A4:1:3:2
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="innodb-information-schema-examples-null-blocking-query">
       </a>
       Identifying a Blocking Query After the Issuing Session Becomes Idle
      </h5>
     </div>
    </div>
   </div>
   <p>
    When identifying blocking transactions, a NULL value is
          reported for the blocking query if the session that issued the
          query has become idle. In this case, use the following steps
          to determine the blocking query:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Identify the processlist ID of the blocking transaction.
              In the
       <a class="link" href="sys-innodb-lock-waits.html" title="30.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views">
        <code class="literal">
         sys.innodb_lock_waits
        </code>
       </a>
       table, the processlist ID of the blocking transaction is
              the
       <code class="literal">
        blocking_pid
       </code>
       value.
      </p>
     </li>
     <li class="listitem">
      <p>
       Using the
       <code class="literal">
        blocking_pid
       </code>
       , query the MySQL
              Performance Schema
       <a class="link" href="performance-schema-threads-table.html" title="29.12.22.8 The threads Table">
        <code class="literal">
         threads
        </code>
       </a>
       table to determine the
       <code class="literal">
        THREAD_ID
       </code>
       of the
              blocking transaction. For example, if the
       <code class="literal">
        blocking_pid
       </code>
       is 6, issue this query:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa55216958"><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-sql"><span class="token keyword">SELECT</span> THREAD_ID <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>threads <span class="token keyword">WHERE</span> PROCESSLIST_ID <span class="token operator">=</span> <span class="token number">6</span><span class="token punctuation">;</span></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Using the
       <code class="literal">
        THREAD_ID
       </code>
       , query the
              Performance Schema
       <a class="link" href="performance-schema-events-statements-current-table.html" title="29.12.6.1 The events_statements_current Table">
        <code class="literal">
         events_statements_current
        </code>
       </a>
       table to determine the last query executed by the thread.
              For example, if the
       <code class="literal">
        THREAD_ID
       </code>
       is 28,
              issue this query:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29147017"><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-sql"><span class="token keyword">SELECT</span> THREAD_ID<span class="token punctuation">,</span> SQL_TEXT <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>events_statements_current
<span class="token keyword">WHERE</span> THREAD_ID <span class="token operator">=</span> <span class="token number">28</span>\G</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       If the last query executed by the thread is not enough
              information to determine why a lock is held, you can query
              the Performance Schema
       <a class="link" href="performance-schema-events-statements-history-table.html" title="29.12.6.2 The events_statements_history Table">
        <code class="literal">
         events_statements_history
        </code>
       </a>
       table to view the last 10 statements executed by the
              thread.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa93028929"><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-sql"><span class="token keyword">SELECT</span> THREAD_ID<span class="token punctuation">,</span> SQL_TEXT <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>events_statements_history
<span class="token keyword">WHERE</span> THREAD_ID <span class="token operator">=</span> <span class="token number">28</span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> EVENT_ID<span class="token punctuation">;</span></code></pre>
      </div>
     </li>
    </ol>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="innodb-information-schema-sample-locks">
       </a>
       Correlating InnoDB Transactions with MySQL Sessions
      </h5>
     </div>
    </div>
   </div>
   <p>
    Sometimes it is useful to correlate internal
    <code class="literal">
     InnoDB
    </code>
    locking information with the
          session-level information maintained by MySQL. For example,
          you might like to know, for a given
    <code class="literal">
     InnoDB
    </code>
    transaction ID, the corresponding MySQL session ID and name of
          the session that may be holding a lock, and thus blocking
          other transactions.
   </p>
   <p>
    The following output from the
    <code class="literal">
     INFORMATION_SCHEMA
    </code>
    <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
     <code class="literal">
      INNODB_TRX
     </code>
    </a>
    table and Performance
          Schema
    <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
     <code class="literal">
      data_locks
     </code>
    </a>
    and
    <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
     <code class="literal">
      data_lock_waits
     </code>
    </a>
    tables is taken
          from a somewhat loaded system. As can be seen, there are
          several transactions running.
   </p>
   <p>
    The following
    <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
     <code class="literal">
      data_locks
     </code>
    </a>
    and
    <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
     <code class="literal">
      data_lock_waits
     </code>
    </a>
    tables show that:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        77F
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transactions
       <code class="literal">
        77E
       </code>
       ,
       <code class="literal">
        77D
       </code>
       , and
       <code class="literal">
        77B
       </code>
       to
              commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        77E
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transactions
       <code class="literal">
        77D
       </code>
       and
       <code class="literal">
        77B
       </code>
       to commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        77D
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transaction
       <code class="literal">
        77B
       </code>
       to commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        77B
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transaction
       <code class="literal">
        77A
       </code>
       to commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        77A
       </code>
       is running, currently
              executing
       <a class="link" href="select.html" title="15.2.13 SELECT Statement">
        <code class="literal">
         SELECT
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        E56
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transaction
       <code class="literal">
        E55
       </code>
       to commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        E55
       </code>
       (executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       ) is waiting for
              transaction
       <code class="literal">
        19C
       </code>
       to commit.
      </p>
     </li>
     <li class="listitem">
      <p>
       Transaction
       <code class="literal">
        19C
       </code>
       is running, currently
              executing an
       <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
        <code class="literal">
         INSERT
        </code>
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     There may be inconsistencies between queries shown in the
     <code class="literal">
      INFORMATION_SCHEMA
     </code>
     <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
      <code class="literal">
       PROCESSLIST
      </code>
     </a>
     and
     <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
      <code class="literal">
       INNODB_TRX
      </code>
     </a>
     tables. For an
            explanation, see
     <a class="xref" href="innodb-information-schema-internal-data.html" title="17.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">
      Section 17.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
        Information”
     </a>
     .
    </p>
   </div>
   <p>
    The following table shows the contents of the
    <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
     <code class="literal">
      PROCESSLIST
     </code>
    </a>
    table for a system
          running a heavy
    <a class="link" href="glossary.html#glos_workload" title="workload">
     workload
    </a>
    .
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-sample-processlist">
    </a>
    <table summary="Sample data from the INFORMATION_SCHEMA.PROCESSLIST table, showing the internal workings of MySQL processes under a heavy workload.">
     <colgroup>
      <col style="width: 8%"/>
      <col style="width: 11%"/>
      <col style="width: 21%"/>
      <col style="width: 10%"/>
      <col style="width: 20%"/>
      <col style="width: 10%"/>
      <col style="width: 20%"/>
      <col style="width: 25%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        ID
       </th>
       <th scope="col">
        USER
       </th>
       <th scope="col">
        HOST
       </th>
       <th scope="col">
        DB
       </th>
       <th scope="col">
        COMMAND
       </th>
       <th scope="col">
        TIME
       </th>
       <th scope="col">
        STATE
       </th>
       <th scope="col">
        INFO
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         384
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         10
        </code>
       </td>
       <td>
        <code class="literal">
         update
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         257
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         3
        </code>
       </td>
       <td>
        <code class="literal">
         update
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         130
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         0
        </code>
       </td>
       <td>
        <code class="literal">
         update
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         61
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         1
        </code>
       </td>
       <td>
        <code class="literal">
         update
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         8
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         1
        </code>
       </td>
       <td>
        <code class="literal">
         update
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         4
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Query
        </code>
       </td>
       <td>
        <code class="literal">
         0
        </code>
       </td>
       <td>
        <code class="literal">
         preparing
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT * FROM PROCESSLIST
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         2
        </code>
       </th>
       <td>
        <code class="literal">
         root
        </code>
       </td>
       <td>
        <code class="literal">
         localhost
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         Sleep
        </code>
       </td>
       <td>
        <code class="literal">
         566
        </code>
       </td>
       <td>
        <code class="literal">
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    The following table shows the contents of the
    <a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
     <code class="literal">
      INNODB_TRX
     </code>
    </a>
    table for a system
          running a heavy
    <a class="link" href="glossary.html#glos_workload" title="workload">
     workload
    </a>
    .
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-sample-innodb-trx">
    </a>
    <table summary="Sample data from the INFORMATION_SCHEMA.INNODB_TRX table, showing the internal workings of InnoDB transactions under a heavy workload.">
     <colgroup>
      <col style="width: 8%"/>
      <col style="width: 10%"/>
      <col style="width: 19%"/>
      <col style="width: 21%"/>
      <col style="width: 19%"/>
      <col style="width: 10%"/>
      <col style="width: 10%"/>
      <col style="width: 31%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        trx id
       </th>
       <th scope="col">
        trx state
       </th>
       <th scope="col">
        trx started
       </th>
       <th scope="col">
        trx requested lock id
       </th>
       <th scope="col">
        trx wait started
       </th>
       <th scope="col">
        trx weight
       </th>
       <th scope="col">
        trx mysql thread id
       </th>
       <th scope="col">
        trx query
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         77F
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         77F
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         1
        </code>
       </td>
       <td>
        <code class="literal">
         876
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t09 (D, B, C) VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77E
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         77E
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         1
        </code>
       </td>
       <td>
        <code class="literal">
         875
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t09 (D, B, C) VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77D
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         77D
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         1
        </code>
       </td>
       <td>
        <code class="literal">
         874
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t09 (D, B, C) VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77B
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         77B:733:12:1
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         4
        </code>
       </td>
       <td>
        <code class="literal">
         873
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t09 (D, B, C) VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77A
        </code>
       </th>
       <td>
        <code class="literal">
         RUN­NING
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:16
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         4
        </code>
       </td>
       <td>
        <code class="literal">
         872
        </code>
       </td>
       <td>
        <code class="literal">
         SELECT b, c FROM t09 WHERE …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E56
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:06
        </code>
       </td>
       <td>
        <code class="literal">
         E56:743:6:2
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:06
        </code>
       </td>
       <td>
        <code class="literal">
         5
        </code>
       </td>
       <td>
        <code class="literal">
         384
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E55
        </code>
       </th>
       <td>
        <code class="literal">
         LOCK WAIT
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:06
        </code>
       </td>
       <td>
        <code class="literal">
         E55:743:38:2
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:10:13
        </code>
       </td>
       <td>
        <code class="literal">
         965
        </code>
       </td>
       <td>
        <code class="literal">
         257
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         19C
        </code>
       </th>
       <td>
        <code class="literal">
         RUN­NING
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:09:10
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         2900
        </code>
       </td>
       <td>
        <code class="literal">
         130
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E15
        </code>
       </th>
       <td>
        <code class="literal">
         RUN­NING
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:08:59
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         5395
        </code>
       </td>
       <td>
        <code class="literal">
         61
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         51D
        </code>
       </th>
       <td>
        <code class="literal">
         RUN­NING
        </code>
       </td>
       <td>
        <code class="literal">
         2008-01-15 13:08:47
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         9807
        </code>
       </td>
       <td>
        <code class="literal">
         8
        </code>
       </td>
       <td>
        <code class="literal">
         INSERT INTO t2 VALUES …
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="informaltable">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th scope="col" style="width: 55.7344px;">
        trx id
       </th>
       <th scope="col" style="width: 70.1719px;">
        trx state
       </th>
       <th scope="col" style="width: 132.094px;">
        trx started
       </th>
       <th scope="col" style="width: 148.953px;">
        trx requested lock id
       </th>
       <th scope="col" style="width: 132.094px;">
        trx wait started
       </th>
       <th scope="col" style="width: 71.625px;">
        trx weight
       </th>
       <th scope="col" style="width: 71.5312px;">
        trx mysql thread id
       </th>
       <th scope="col" style="width: 55.7969px;">
        trx query
       </th>
      </tr>
     </thead>
    </table>
   </div>
   <p>
    The following table shows the contents of the
    <a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
     <code class="literal">
      data_lock_waits
     </code>
    </a>
    table for a
          system running a heavy
    <a class="link" href="glossary.html#glos_workload" title="workload">
     workload
    </a>
    .
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-sample-innodb-lock-waits">
    </a>
    <table summary="Sample data from the Performance Schema data_lock_waits table, showing the internal workings of InnoDB locking under a heavy workload.">
     <colgroup>
      <col style="width: 25%"/>
      <col style="width: 25%"/>
      <col style="width: 25%"/>
      <col style="width: 25%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        requesting trx id
       </th>
       <th scope="col">
        requested lock id
       </th>
       <th scope="col">
        blocking trx id
       </th>
       <th scope="col">
        blocking lock id
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         77F
        </code>
       </th>
       <td>
        <code class="literal">
         77F:806
        </code>
       </td>
       <td>
        <code class="literal">
         77E
        </code>
       </td>
       <td>
        <code class="literal">
         77E:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77F
        </code>
       </th>
       <td>
        <code class="literal">
         77F:806
        </code>
       </td>
       <td>
        <code class="literal">
         77D
        </code>
       </td>
       <td>
        <code class="literal">
         77D:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77F
        </code>
       </th>
       <td>
        <code class="literal">
         77F:806
        </code>
       </td>
       <td>
        <code class="literal">
         77B
        </code>
       </td>
       <td>
        <code class="literal">
         77B:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77E
        </code>
       </th>
       <td>
        <code class="literal">
         77E:806
        </code>
       </td>
       <td>
        <code class="literal">
         77D
        </code>
       </td>
       <td>
        <code class="literal">
         77D:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77E
        </code>
       </th>
       <td>
        <code class="literal">
         77E:806
        </code>
       </td>
       <td>
        <code class="literal">
         77B
        </code>
       </td>
       <td>
        <code class="literal">
         77B:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77D
        </code>
       </th>
       <td>
        <code class="literal">
         77D:806
        </code>
       </td>
       <td>
        <code class="literal">
         77B
        </code>
       </td>
       <td>
        <code class="literal">
         77B:806
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77B
        </code>
       </th>
       <td>
        <code class="literal">
         77B:733:12:1
        </code>
       </td>
       <td>
        <code class="literal">
         77A
        </code>
       </td>
       <td>
        <code class="literal">
         77A:733:12:1
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E56
        </code>
       </th>
       <td>
        <code class="literal">
         E56:743:6:2
        </code>
       </td>
       <td>
        <code class="literal">
         E55
        </code>
       </td>
       <td>
        <code class="literal">
         E55:743:6:2
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E55
        </code>
       </th>
       <td>
        <code class="literal">
         E55:743:38:2
        </code>
       </td>
       <td>
        <code class="literal">
         19C
        </code>
       </td>
       <td>
        <code class="literal">
         19C:743:38:2
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    The following table shows the contents of the
    <a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
     <code class="literal">
      data_locks
     </code>
    </a>
    table for a system
          running a heavy
    <a class="link" href="glossary.html#glos_workload" title="workload">
     workload
    </a>
    .
   </p>
   <div class="informaltable">
    <a name="innodb-information-schema-sample-innodb-locks">
    </a>
    <table summary="Sample data from the Performance Schema data_locks table, showing the internal workings of InnoDB locking under a heavy workload.">
     <colgroup>
      <col style="width: 18%"/>
      <col style="width: 9%"/>
      <col style="width: 12%"/>
      <col style="width: 12%"/>
      <col style="width: 9%"/>
      <col style="width: 8%"/>
      <col style="width: 15%"/>
      <col style="width: 17%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        lock id
       </th>
       <th scope="col">
        lock trx id
       </th>
       <th scope="col">
        lock mode
       </th>
       <th scope="col">
        lock type
       </th>
       <th scope="col">
        lock schema
       </th>
       <th scope="col">
        lock table
       </th>
       <th scope="col">
        lock index
       </th>
       <th scope="col">
        lock data
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        <code class="literal">
         77F:806
        </code>
       </th>
       <td>
        <code class="literal">
         77F
        </code>
       </td>
       <td>
        <code class="literal">
         AUTO_INC
        </code>
       </td>
       <td>
        <code class="literal">
         TABLE
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77E:806
        </code>
       </th>
       <td>
        <code class="literal">
         77E
        </code>
       </td>
       <td>
        <code class="literal">
         AUTO_INC
        </code>
       </td>
       <td>
        <code class="literal">
         TABLE
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77D:806
        </code>
       </th>
       <td>
        <code class="literal">
         77D
        </code>
       </td>
       <td>
        <code class="literal">
         AUTO_INC
        </code>
       </td>
       <td>
        <code class="literal">
         TABLE
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77B:806
        </code>
       </th>
       <td>
        <code class="literal">
         77B
        </code>
       </td>
       <td>
        <code class="literal">
         AUTO_INC
        </code>
       </td>
       <td>
        <code class="literal">
         TABLE
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
       <td>
        <code class="literal">
         NULL
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77B:733:12:1
        </code>
       </th>
       <td>
        <code class="literal">
         77B
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         supremum pseudo-record
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         77A:733:12:1
        </code>
       </th>
       <td>
        <code class="literal">
         77A
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t09
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         supremum pseudo-record
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E56:743:6:2
        </code>
       </th>
       <td>
        <code class="literal">
         E56
        </code>
       </td>
       <td>
        <code class="literal">
         S
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t2
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         0, 0
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E55:743:6:2
        </code>
       </th>
       <td>
        <code class="literal">
         E55
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t2
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         0, 0
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         E55:743:38:2
        </code>
       </th>
       <td>
        <code class="literal">
         E55
        </code>
       </td>
       <td>
        <code class="literal">
         S
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t2
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         1922, 1922
        </code>
       </td>
      </tr>
      <tr>
       <th scope="row">
        <code class="literal">
         19C:743:38:2
        </code>
       </th>
       <td>
        <code class="literal">
         19C
        </code>
       </td>
       <td>
        <code class="literal">
         X
        </code>
       </td>
       <td>
        <code class="literal">
         RECORD
        </code>
       </td>
       <td>
        <code class="literal">
         test
        </code>
       </td>
       <td>
        <code class="literal">
         t2
        </code>
       </td>
       <td>
        <code class="literal">
         PRIMARY
        </code>
       </td>
       <td>
        <code class="literal">
         1922, 1922
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="informaltable">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th scope="col" style="width: 132.844px;">
        lock id
       </th>
       <th scope="col" style="width: 66.4062px;">
        lock trx id
       </th>
       <th scope="col" style="width: 88.5469px;">
        lock mode
       </th>
       <th scope="col" style="width: 88.5469px;">
        lock type
       </th>
       <th scope="col" style="width: 66.4062px;">
        lock schema
       </th>
       <th scope="col" style="width: 59.0312px;">
        lock table
       </th>
       <th scope="col" style="width: 110.688px;">
        lock index
       </th>
       <th scope="col" style="width: 125.531px;">
        lock data
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
 </div>
 <br/>
</div>
