<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-ndbinfo-operations-per-fragment">
      </a>
      25.6.17.49 The ndbinfo operations_per_fragment Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045088412016">
  </a>
  <p>
   The
   <code class="literal">
    operations_per_fragment
   </code>
   table provides
        information about the operations performed on individual
        fragments and fragment replicas, as well as about some of the
        results from these operations.
  </p>
  <p>
   The
   <code class="literal">
    operations_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>
      Name of this fragment
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       parent_fq_name
      </code>
     </p>
     <p>
      Name of this fragment's parent
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       type
      </code>
     </p>
     <p>
      Type of object; see text for possible values
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       table_id
      </code>
     </p>
     <p>
      Table ID for this table
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       node_id
      </code>
     </p>
     <p>
      Node ID for this node
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       block_instance
      </code>
     </p>
     <p>
      Kernel block instance ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fragment_num
      </code>
     </p>
     <p>
      Fragment ID (number)
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_reads
      </code>
     </p>
     <p>
      Total number of key reads for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_inserts
      </code>
     </p>
     <p>
      Total number of key inserts for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_updates
      </code>
     </p>
     <p>
      total number of key updates for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_writes
      </code>
     </p>
     <p>
      Total number of key writes for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_deletes
      </code>
     </p>
     <p>
      Total number of key deletes for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_refs
      </code>
     </p>
     <p>
      Number of key operations refused
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_attrinfo_bytes
      </code>
     </p>
     <p>
      Total size of all
      <code class="literal">
       attrinfo
      </code>
      attributes
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_keyinfo_bytes
      </code>
     </p>
     <p>
      Total size of all
      <code class="literal">
       keyinfo
      </code>
      attributes
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_prog_bytes
      </code>
     </p>
     <p>
      Total size of all interpreted programs carried by
      <code class="literal">
       attrinfo
      </code>
      attributes
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_inst_exec
      </code>
     </p>
     <p>
      Total number of instructions executed by interpreted
            programs for key operations
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_key_bytes_returned
      </code>
     </p>
     <p>
      Total size of all data and metadata returned from key read
            operations
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_frag_scans
      </code>
     </p>
     <p>
      Total number of scans performed on this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_rows_examined
      </code>
     </p>
     <p>
      Total number of rows examined by scans
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_rows_returned
      </code>
     </p>
     <p>
      Total number of rows returned to client
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_bytes_returned
      </code>
     </p>
     <p>
      Total size of data and metadata returned to the client
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_prog_bytes
      </code>
     </p>
     <p>
      Total size of interpreted programs for scan operations
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_bound_bytes
      </code>
     </p>
     <p>
      Total size of all bounds used in ordered index scans
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_scan_inst_exec
      </code>
     </p>
     <p>
      Total number of instructions executed for scans
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tot_qd_frag_scans
      </code>
     </p>
     <p>
      Number of times that scans of this fragment replica have
            been queued
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       conc_frag_scans
      </code>
     </p>
     <p>
      Number of scans currently active on this fragment replica
            (excluding queued scans)
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       conc_qd_frag_scans
      </code>
     </p>
     <p>
      Number of scans currently queued for this fragment replica
     </p>
    </li>
    <li class="listitem">
     <p>
      tot_commits
     </p>
     <p>
      Total number of row changes committed to this fragment
            replica
     </p>
    </li>
   </ul>
  </div>
  <h5>
   <a name="idm46045088350224">
   </a>
   Notes
  </h5>
  <p>
   The
   <code class="literal">
    fq_name
   </code>
   contains the fully qualified name
        of the schema object to which this fragment replica belongs.
        This currently has the following formats:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Base table:
      <code class="literal">
       <em class="replaceable">
        <code>
         DbName
        </code>
       </em>
       /def/
       <em class="replaceable">
        <code>
         TblName
        </code>
       </em>
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       BLOB
      </code>
      table:
      <code class="literal">
       <em class="replaceable">
        <code>
         DbName
        </code>
       </em>
       /def/NDB$BLOB_
       <em class="replaceable">
        <code>
         BaseTblId
        </code>
       </em>
       _
       <em class="replaceable">
        <code>
         ColNo
        </code>
       </em>
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      Ordered index:
      <code class="literal">
       sys/def/
       <em class="replaceable">
        <code>
         BaseTblId
        </code>
       </em>
       /
       <em class="replaceable">
        <code>
         IndexName
        </code>
       </em>
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      Unique index:
      <code class="literal">
       sys/def/
       <em class="replaceable">
        <code>
         BaseTblId
        </code>
       </em>
       /
       <em class="replaceable">
        <code>
         IndexName
        </code>
       </em>
       $unique
      </code>
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <code class="literal">
    $unique
   </code>
   suffix shown for unique indexes
        is added by
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   ; for an index created by a
        different NDB API client application, this may differ, or not be
        present.
  </p>
  <p>
   The syntax just shown for fully qualified object names is an
        internal interface which is subject to change in future
        releases.
  </p>
  <p>
   Consider a table
   <code class="literal">
    t1
   </code>
   created and modified by
        the following SQL statements:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96530385"><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">CREATE</span> <span class="token keyword">DATABASE</span> mydb<span class="token punctuation">;</span>

<span class="token keyword">USE</span> mydb<span class="token punctuation">;</span>

<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
  a <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
  b <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
  t <span class="token datatype">TEXT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
  <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>b<span class="token punctuation">)</span>
<span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span><span class="token keyword">ndbcluster</span><span class="token punctuation">;</span>

<span class="token keyword">CREATE</span> <span class="token keyword">UNIQUE</span> <span class="token keyword">INDEX</span> ix1 <span class="token keyword">ON</span> t1<span class="token punctuation">(</span>b<span class="token punctuation">)</span> <span class="token keyword">USING</span> <span class="token keyword">HASH</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If
   <code class="literal">
    t1
   </code>
   is assigned table ID 11, this yields
        the
   <code class="literal">
    fq_name
   </code>
   values shown here:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Base table:
      <code class="literal">
       mydb/def/t1
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       BLOB
      </code>
      table:
      <code class="literal">
       mydb/def/NDB$BLOB_11_2
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      Ordered index (primary key):
      <code class="literal">
       sys/def/11/PRIMARY
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      Unique index:
      <code class="literal">
       sys/def/11/ix1$unique
      </code>
     </p>
    </li>
   </ul>
  </div>
  <p>
   For indexes or
   <code class="literal">
    BLOB
   </code>
   tables, the
   <code class="literal">
    parent_fq_name
   </code>
   column contains the
   <code class="literal">
    fq_name
   </code>
   of the corresponding base table. For
        base tables, this column is always
   <code class="literal">
    NULL
   </code>
   .
  </p>
  <p>
   The
   <code class="literal">
    type
   </code>
   column shows the schema object type
        used for this fragment, which can take any one of the values
   <code class="literal">
    System table
   </code>
   ,
   <code class="literal">
    User table
   </code>
   ,
   <code class="literal">
    Unique hash index
   </code>
   , or
   <code class="literal">
    Ordered
        index
   </code>
   .
   <code class="literal">
    BLOB
   </code>
   tables are shown as
   <code class="literal">
    User table
   </code>
   .
  </p>
  <p>
   The
   <code class="literal">
    table_id
   </code>
   column value is unique at any
        given time, but can be reused if the corresponding object has
        been deleted. The same ID can be seen using the
   <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>
   utility.
  </p>
  <p>
   The
   <code class="literal">
    block_instance
   </code>
   column shows which LDM
        instance this fragment replica belongs to. You can use this to
        obtain information about specific threads from 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. The first
        such instance is always numbered 0.
  </p>
  <p>
   Since there are typically two fragment replicas, and assuming
        that this is so, each
   <code class="literal">
    fragment_num
   </code>
   value
        should appear twice in the table, on two different data nodes
        from the same node group.
  </p>
  <p>
   Since
   <code class="literal">
    NDB
   </code>
   does not use single-key access for
        ordered indexes, the counts for
   <code class="literal">
    tot_key_reads
   </code>
   ,
   <code class="literal">
    tot_key_inserts
   </code>
   ,
   <code class="literal">
    tot_key_updates
   </code>
   ,
   <code class="literal">
    tot_key_writes
   </code>
   , and
   <code class="literal">
    tot_key_deletes
   </code>
   are not incremented by
        ordered index operations.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    When using
    <code class="literal">
     tot_key_writes
    </code>
    , you should keep
          in mind that a write operation in this context updates the row
          if the key exists, and inserts a new row otherwise. (One use
          of this is in the
    <code class="literal">
     NDB
    </code>
    implementation of the
    <a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
     <code class="literal">
      REPLACE
     </code>
    </a>
    SQL statement.)
   </p>
  </div>
  <p>
   The
   <code class="literal">
    tot_key_refs
   </code>
   column shows the number of
        key operations refused by the LDM. Generally, such a refusal is
        due to duplicate keys (inserts),
   <span class="errortext">
    Key not
        found
   </span>
   errors (updates, deletes, and reads), or the
        operation was rejected by an interpreted program used as a
        predicate on the row matching the key.
  </p>
  <p>
   The
   <code class="literal">
    attrinfo
   </code>
   and
   <code class="literal">
    keyinfo
   </code>
   attributes counted by the
   <code class="literal">
    tot_key_attrinfo_bytes
   </code>
   and
   <code class="literal">
    tot_key_keyinfo_bytes
   </code>
   columns are attributes
        of an
   <code class="literal">
    LQHKEYREQ
   </code>
   signal (see
   <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-ndb-protocol.html" target="_top">
    The NDB Communication Protocol
   </a>
   ) used to initiate a
        key operation by the LDM. An
   <code class="literal">
    attrinfo
   </code>
   typically contains tuple field values (inserts and updates) or
        projection specifications (for reads);
   <code class="literal">
    keyinfo
   </code>
   contains the primary or unique key
        needed to locate a given tuple in this schema object.
  </p>
  <p>
   The value shown by
   <code class="literal">
    tot_frag_scans
   </code>
   includes
        both full scans (that examine every row) and scans of subsets.
        Unique indexes and
   <code class="literal">
    BLOB
   </code>
   tables are never
        scanned, so this value, like other scan-related counts, is 0 for
        fragment replicas of these.
  </p>
  <p>
   <code class="literal">
    tot_scan_rows_examined
   </code>
   may display less than
        the total number of rows in a given fragment replica, since
        ordered index scans can limited by bounds. In addition, a client
        may choose to end a scan before all potentially matching rows
        have been examined; this occurs when using an SQL statement
        containing a
   <code class="literal">
    LIMIT
   </code>
   or
   <code class="literal">
    EXISTS
   </code>
   clause, for example.
   <code class="literal">
    tot_scan_rows_returned
   </code>
   is always less than or
        equal to
   <code class="literal">
    tot_scan_rows_examined
   </code>
   .
  </p>
  <p>
   <code class="literal">
    tot_scan_bytes_returned
   </code>
   includes, in the case
        of pushed joins, projections returned to the
   <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-dbspj.html" target="_top">
    <code class="literal">
     DBSPJ
    </code>
   </a>
   block in the NDB
        kernel.
  </p>
  <p>
   <code class="literal">
    tot_qd_frag_scans
   </code>
   can be effected by the
        setting for the
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-maxparallelscansperfragment">
    <code class="literal">
     MaxParallelScansPerFragment
    </code>
   </a>
   data node configuration parameter, which limits the number of
        scans that may execute concurrently on a single fragment
        replica.
  </p>
 </div>
 <br/>
</div>
