<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-ndbinfo-locks-per-fragment">
      </a>
      25.6.17.42 The ndbinfo locks_per_fragment Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045089088032">
  </a>
  <p>
   The
   <code class="literal">
    locks_per_fragment
   </code>
   table provides
        information about counts of lock claim requests, and the
        outcomes of these requests on a per-fragment basis, serving as a
        companion table to
   <a class="link" href="mysql-cluster-ndbinfo-operations-per-fragment.html" title="25.6.17.49 The ndbinfo operations_per_fragment Table">
    <code class="literal">
     operations_per_fragment
    </code>
   </a>
   and
   <a class="link" href="mysql-cluster-ndbinfo-memory-per-fragment.html" title="25.6.17.47 The ndbinfo memory_per_fragment Table">
    <code class="literal">
     memory_per_fragment
    </code>
   </a>
   . This
        table also shows the total time spent waiting for locks
        successfully and unsuccessfully since fragment or table
        creation, or since the most recent restart.
  </p>
  <p>
   The
   <code class="literal">
    locks_per_fragment
   </code>
   table contains the
        following columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       fq_name
      </code>
     </p>
     <p>
      Fully qualified table name
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       parent_fq_name
      </code>
     </p>
     <p>
      Fully qualified name of parent object
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       type
      </code>
     </p>
     <p>
      Table type; see text for possible values
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       table_id
      </code>
     </p>
     <p>
      Table ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       node_id
      </code>
     </p>
     <p>
      Reporting node ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       block_instance
      </code>
     </p>
     <p>
      LDM instance ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fragment_num
      </code>
     </p>
     <p>
      Fragment identifier
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ex_req
      </code>
     </p>
     <p>
      Exclusive lock requests started
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ex_imm_ok
      </code>
     </p>
     <p>
      Exclusive lock requests immediately granted
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ex_wait_ok
      </code>
     </p>
     <p>
      Exclusive lock requests granted following wait
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ex_wait_fail
      </code>
     </p>
     <p>
      Exclusive lock requests not granted
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sh_req
      </code>
     </p>
     <p>
      Shared lock requests started
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sh_imm_ok
      </code>
     </p>
     <p>
      Shared lock requests immediately granted
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sh_wait_ok
      </code>
     </p>
     <p>
      Shared lock requests granted following wait
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sh_wait_fail
      </code>
     </p>
     <p>
      Shared lock requests not granted
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       wait_ok_millis
      </code>
     </p>
     <p>
      Time spent waiting for lock requests that were granted, in
            milliseconds
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       wait_fail_millis
      </code>
     </p>
     <p>
      Time spent waiting for lock requests that failed, in
            milliseconds
     </p>
    </li>
   </ul>
  </div>
  <h5>
   <a name="idm46045089048400">
   </a>
   Notes
  </h5>
  <p>
   <code class="literal">
    block_instance
   </code>
   refers to an instance of a
        kernel block. Together with the block name, this number can be
        used to look up a given instance in the
   <a class="link" href="mysql-cluster-ndbinfo-threadblocks.html" title="25.6.17.62 The ndbinfo threadblocks Table">
    <code class="literal">
     threadblocks
    </code>
   </a>
   table.
  </p>
  <p>
   <code class="literal">
    fq_name
   </code>
   is a fully qualified database object
        name in
   <em class="replaceable">
    <code>
     database
    </code>
   </em>
   /
   <em class="replaceable">
    <code>
     schema
    </code>
   </em>
   /
   <em class="replaceable">
    <code>
     name
    </code>
   </em>
   format, such as
   <code class="literal">
    test/def/t1
   </code>
   or
   <code class="literal">
    sys/def/10/b$unique
   </code>
   .
  </p>
  <p>
   <code class="literal">
    parent_fq_name
   </code>
   is the fully qualified name of
        this object's parent object (table).
  </p>
  <p>
   <code class="literal">
    table_id
   </code>
   is the table's internal ID
        generated by
   <code class="literal">
    NDB
   </code>
   . This is the same internal
        table ID shown in other
   <code class="literal">
    ndbinfo
   </code>
   tables; it is
        also visible in the output of
   <a class="link" href="mysql-cluster-programs-ndb-show-tables.html" title="25.5.27 ndb_show_tables — Display List of NDB Tables">
    <span class="command">
     <strong>
      ndb_show_tables
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   The
   <code class="literal">
    type
   </code>
   column shows the type of table. This
        is always one of
   <code class="literal">
    System table
   </code>
   ,
   <code class="literal">
    User
        table
   </code>
   ,
   <code class="literal">
    Unique hash index
   </code>
   ,
   <code class="literal">
    Hash index
   </code>
   ,
   <code class="literal">
    Unique ordered
        index
   </code>
   ,
   <code class="literal">
    Ordered index
   </code>
   ,
   <code class="literal">
    Hash
        index trigger
   </code>
   ,
   <code class="literal">
    Subscription
        trigger
   </code>
   ,
   <code class="literal">
    Read only constraint
   </code>
   ,
   <code class="literal">
    Index trigger
   </code>
   ,
   <code class="literal">
    Reorganize
        trigger
   </code>
   ,
   <code class="literal">
    Tablespace
   </code>
   ,
   <code class="literal">
    Log
        file group
   </code>
   ,
   <code class="literal">
    Data file
   </code>
   ,
   <code class="literal">
    Undo file
   </code>
   ,
   <code class="literal">
    Hash map
   </code>
   ,
   <code class="literal">
    Foreign key definition
   </code>
   ,
   <code class="literal">
    Foreign key
        parent trigger
   </code>
   ,
   <code class="literal">
    Foreign key child
        trigger
   </code>
   , or
   <code class="literal">
    Schema transaction
   </code>
   .
  </p>
  <p>
   The values shown in all of the columns
   <code class="literal">
    ex_req
   </code>
   ,
   <code class="literal">
    ex_req_imm_ok
   </code>
   ,
   <code class="literal">
    ex_wait_ok
   </code>
   ,
   <code class="literal">
    ex_wait_fail
   </code>
   ,
   <code class="literal">
    sh_req
   </code>
   ,
   <code class="literal">
    sh_req_imm_ok
   </code>
   ,
   <code class="literal">
    sh_wait_ok
   </code>
   , and
   <code class="literal">
    sh_wait_fail
   </code>
   represent cumulative numbers of
        requests since the table or fragment was created, or since the
        last restart of this node, whichever of these occurred later.
        This is also true for the time values shown in the
   <code class="literal">
    wait_ok_millis
   </code>
   and
   <code class="literal">
    wait_fail_millis
   </code>
   columns.
  </p>
  <p>
   Every lock request is considered either to be in progress, or to
        have completed in some way (that is, to have succeeded or
        failed). This means that the following relationships are true:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa55878428"><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-simple">ex_req <span class="token operator">&gt;=</span> <span class="token punctuation">(</span>ex_req_imm_ok <span class="token operator">+</span> ex_wait_ok <span class="token operator">+</span> ex_wait_fail<span class="token punctuation">)</span>

sh_req <span class="token operator">&gt;=</span> <span class="token punctuation">(</span>sh_req_imm_ok <span class="token operator">+</span> sh_wait_ok <span class="token operator">+</span> sh_wait_fail<span class="token punctuation">)</span></code></pre>
  </div>
  <p>
   The number of requests currently in progress is the current
        number of incomplete requests, which can be found as shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa40026695"><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-simple"><span class="token punctuation">[</span>exclusive lock requests in progress<span class="token punctuation">]</span> <span class="token operator">=</span>
    ex_req <span class="token operator">-</span> <span class="token punctuation">(</span>ex_req_imm_ok <span class="token operator">+</span> ex_wait_ok <span class="token operator">+</span> ex_wait_fail<span class="token punctuation">)</span>

<span class="token punctuation">[</span>shared lock requests in progress<span class="token punctuation">]</span> <span class="token operator">=</span>
    sh_req <span class="token operator">-</span> <span class="token punctuation">(</span>sh_req_imm_ok <span class="token operator">+</span> sh_wait_ok <span class="token operator">+</span> sh_wait_fail<span class="token punctuation">)</span></code></pre>
  </div>
  <p>
   A failed wait indicates an aborted transaction, but the abort
        may or may not be caused by a lock wait timeout. You can obtain
        the total number of aborts while waiting for locks as shown
        here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa91462517"><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-simple"><span class="token punctuation">[</span>aborts while waiting for locks<span class="token punctuation">]</span> <span class="token operator">=</span> ex_wait_fail <span class="token operator">+</span> sh_wait_fail</code></pre>
  </div>
 </div>
 <br/>
</div>
