<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="sys-innodb-lock-waits">
      </a>
      30.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045063132128">
  </a>
  <a class="indexterm" name="idm46045063130672">
  </a>
  <a class="indexterm" name="idm46045063129184">
  </a>
  <a class="indexterm" name="idm46045063127680">
  </a>
  <p>
   These views summarize the
   <code class="literal">
    InnoDB
   </code>
   locks that
          transactions are waiting for. By default, rows are sorted by
          descending lock age.
  </p>
  <p>
   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">
     innodb_lock_waits
    </code>
   </a>
   and
   <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">
     x$innodb_lock_waits
    </code>
   </a>
   views have
          these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       wait_started
      </code>
     </p>
     <p>
      The time at which the lock wait started.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       wait_age
      </code>
     </p>
     <p>
      How long the lock has been waited for, as a
      <a class="link" href="time.html" title="13.2.3 The TIME Type">
       <code class="literal">
        TIME
       </code>
      </a>
      value.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       wait_age_secs
      </code>
     </p>
     <p>
      How long the lock has been waited for, in seconds.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_table_schema
      </code>
     </p>
     <p>
      The schema that contains the locked table.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_table_name
      </code>
     </p>
     <p>
      The name of the locked table.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_table_partition
      </code>
     </p>
     <p>
      The name of the locked partition, if any;
      <code class="literal">
       NULL
      </code>
      otherwise.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_table_subpartition
      </code>
     </p>
     <p>
      The name of the locked subpartition, if any;
      <code class="literal">
       NULL
      </code>
      otherwise.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_index
      </code>
     </p>
     <p>
      The name of the locked index.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       locked_type
      </code>
     </p>
     <p>
      The type of the waiting lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_trx_id
      </code>
     </p>
     <p>
      The ID of the waiting transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_trx_started
      </code>
     </p>
     <p>
      The time at which the waiting transaction started.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_trx_age
      </code>
     </p>
     <p>
      How long the waiting transaction has been waiting, as a
      <a class="link" href="time.html" title="13.2.3 The TIME Type">
       <code class="literal">
        TIME
       </code>
      </a>
      value.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_trx_rows_locked
      </code>
     </p>
     <p>
      The number of rows locked by the waiting transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_trx_rows_modified
      </code>
     </p>
     <p>
      The number of rows modified by the waiting transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_pid
      </code>
     </p>
     <p>
      The processlist ID of the waiting transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_query
      </code>
     </p>
     <p>
      The statement that is waiting for the lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_lock_id
      </code>
     </p>
     <p>
      The ID of the waiting lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       waiting_lock_mode
      </code>
     </p>
     <p>
      The mode of the waiting lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_trx_id
      </code>
     </p>
     <p>
      The ID of the transaction that is blocking the waiting
              lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_pid
      </code>
     </p>
     <p>
      The processlist ID of the blocking transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_query
      </code>
     </p>
     <p>
      The statement the blocking transaction is executing. This
              field reports NULL if the session that issued the blocking
              query becomes idle. For more information, 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>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_lock_id
      </code>
     </p>
     <p>
      The ID of the lock that is blocking the waiting lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_lock_mode
      </code>
     </p>
     <p>
      The mode of the lock that is blocking the waiting lock.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_trx_started
      </code>
     </p>
     <p>
      The time at which the blocking transaction started.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_trx_age
      </code>
     </p>
     <p>
      How long the blocking transaction has been executing, as a
      <a class="link" href="time.html" title="13.2.3 The TIME Type">
       <code class="literal">
        TIME
       </code>
      </a>
      value.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_trx_rows_locked
      </code>
     </p>
     <p>
      The number of rows locked by the blocking transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       blocking_trx_rows_modified
      </code>
     </p>
     <p>
      The number of rows modified by the blocking transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sql_kill_blocking_query
      </code>
     </p>
     <p>
      The
      <a class="link" href="kill.html" title="15.7.8.4 KILL Statement">
       <code class="literal">
        KILL
       </code>
      </a>
      statement to
              execute to kill the blocking statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sql_kill_blocking_connection
      </code>
     </p>
     <p>
      The
      <a class="link" href="kill.html" title="15.7.8.4 KILL Statement">
       <code class="literal">
        KILL
       </code>
      </a>
      statement to
              execute to kill the session running the blocking
              statement.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
