<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-ndbinfo-memory-per-fragment">
      </a>
      25.6.17.47 The ndbinfo memory_per_fragment Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045088840496">
  </a>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-notes" title="memory_per_fragment Table: Notes">
       memory_per_fragment Table: Notes
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-examples" title="memory_per_fragment Table: Examples">
       memory_per_fragment Table: Examples
      </a>
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <code class="literal">
    memory_per_fragment
   </code>
   table provides
        information about the usage of memory by individual fragments.
        See the
   <a class="link" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-notes" title="memory_per_fragment Table: Notes">
    Notes
   </a>
   later in this section to see how you can use this to find out
        how much memory is used by
   <code class="literal">
    NDB
   </code>
   tables.
  </p>
  <p>
   The
   <code class="literal">
    memory_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>
      Dictionary object type
            (
      <a class="ulink" href="/doc/ndbapi/en/ndb-object.html#ndb-object-type" target="_top">
       <code class="literal">
        Object::Type
       </code>
      </a>
      , in the NDB
            API) used for this fragment; 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>
      You can also obtain this list by executing
      <a class="link" href="table.html" title="15.2.16 TABLE Statement">
       <code class="literal">
        TABLE
       </code>
      </a>
      <a class="link" href="mysql-cluster-ndbinfo-dict-obj-types.html" title="25.6.17.27 The ndbinfo dict_obj_types Table">
       <code class="literal">
        ndbinfo.dict_obj_types
       </code>
      </a>
      in
            the
      <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
       <span class="command">
        <strong>
         mysql
        </strong>
       </span>
      </a>
      client.
     </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>
      NDB kernel block instance ID; you can use this number 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.
     </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">
       fixed_elem_alloc_bytes
      </code>
     </p>
     <p>
      Number of bytes allocated for fixed-sized elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fixed_elem_free_bytes
      </code>
     </p>
     <p>
      Free bytes remaining in pages allocated to fixed-size
            elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fixed_elem_size_bytes
      </code>
     </p>
     <p>
      Length of each fixed-size element in bytes
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fixed_elem_count
      </code>
     </p>
     <p>
      Number of fixed-size elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       fixed_elem_free_count
      </code>
     </p>
     <p>
      Number of free rows for fixed-size elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       var_elem_alloc_bytes
      </code>
     </p>
     <p>
      Number of bytes allocated for variable-size elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       var_elem_free_bytes
      </code>
     </p>
     <p>
      Free bytes remaining in pages allocated to variable-size
            elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       var_elem_count
      </code>
     </p>
     <p>
      Number of variable-size elements
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       hash_index_alloc_bytes
      </code>
     </p>
     <p>
      Number of bytes allocated to hash indexes
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-cluster-ndbinfo-memory-per-fragment-notes">
       </a>
       memory_per_fragment Table: Notes
      </h5>
     </div>
    </div>
   </div>
   <p>
    The
    <code class="literal">
     memory_per_fragment
    </code>
    table contains one
          row for every table fragment replica and every index fragment
          replica in the system; this means that, for example, when
    <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-noofreplicas">
     <code class="literal">
      NoOfReplicas=2
     </code>
    </a>
    , there
          are normally two fragment replicas for each fragment. This is
          true as long as all data nodes are running and connected to
          the cluster; for a data node that is missing, there are no
          rows for the fragment replicas that it hosts.
   </p>
   <p>
    The columns of the
    <code class="literal">
     memory_per_fragment
    </code>
    table can be grouped according to their function or purpose as
          follows:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Key columns
        </em>
       </span>
       :
       <code class="literal">
        fq_name
       </code>
       ,
       <code class="literal">
        type
       </code>
       ,
       <code class="literal">
        table_id
       </code>
       ,
       <code class="literal">
        node_id
       </code>
       ,
       <code class="literal">
        block_instance
       </code>
       , and
       <code class="literal">
        fragment_num
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Relationship column
        </em>
       </span>
       :
       <code class="literal">
        parent_fq_name
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Fixed-size storage columns
        </em>
       </span>
       :
       <code class="literal">
        fixed_elem_alloc_bytes
       </code>
       ,
       <code class="literal">
        fixed_elem_free_bytes
       </code>
       ,
       <code class="literal">
        fixed_elem_size_bytes
       </code>
       ,
       <code class="literal">
        fixed_elem_count
       </code>
       , and
       <code class="literal">
        fixed_elem_free_count
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Variable-sized storage columns
        </em>
       </span>
       :
       <code class="literal">
        var_elem_alloc_bytes
       </code>
       ,
       <code class="literal">
        var_elem_free_bytes
       </code>
       , and
       <code class="literal">
        var_elem_count
       </code>
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Hash index column
        </em>
       </span>
       :
       <code class="literal">
        hash_index_alloc_bytes
       </code>
      </p>
     </li>
    </ul>
   </div>
   <p>
    The
    <code class="literal">
     parent_fq_name
    </code>
    and
    <code class="literal">
     fq_name
    </code>
    columns can be used to identify
          indexes associated with a table. Similar schema object
          hierarchy information is available in other
    <code class="literal">
     ndbinfo
    </code>
    tables.
   </p>
   <p>
    Table and index fragment replicas allocate
    <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datamemory">
     <code class="literal">
      DataMemory
     </code>
    </a>
    in 32KB
          pages. These memory pages are managed as listed here:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Fixed-size pages
        </em>
       </span>
       : These store the
              fixed-size parts of rows stored in a given fragment. Every
              row has a fixed-size part.
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Variable-sized pages
        </em>
       </span>
       : These store
              variable-sized parts for rows in the fragment. Every row
              having one or more variable-sized, one or more dynamic
              columns (or both) has a variable-sized part.
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Hash index pages
        </em>
       </span>
       : These are allocated
              as 8 KB subpages, and store the primary key hash index
              structure.
      </p>
     </li>
    </ul>
   </div>
   <p>
    Each row in an
    <code class="literal">
     NDB
    </code>
    table has a fixed-size
          part, consisting of a row header, and one or more fixed-size
          columns. The row may also contain one or more variable-size
          part references, one or more disk part references, or both.
          Each row also has a primary key hash index entry
          (corresponding to the hidden primary key that is part of every
    <code class="literal">
     NDB
    </code>
    table).
   </p>
   <p>
    From the foregoing we can see that each table fragment and
          index fragment together allocate the amount of
    <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datamemory">
     <code class="literal">
      DataMemory
     </code>
    </a>
    calculated
          as shown here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa34547039"><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">DataMemory <span class="token operator">=</span>
  <span class="token punctuation">(</span><em class="replaceable">number_of_fixed_pages</em> <span class="token operator">+</span> <em class="replaceable">number_of_var_pages</em><span class="token punctuation">)</span> <span class="token operator">*</span> 32KB
    <span class="token operator">+</span> <em class="replaceable">number_of_hash_pages</em> <span class="token operator">*</span> 8KB</code></pre>
   </div>
   <p>
    Since
    <code class="literal">
     fixed_elem_alloc_bytes
    </code>
    and
    <code class="literal">
     var_elem_alloc_bytes
    </code>
    are always multiples
          of 32768 bytes, we can further determine that
    <code class="literal">
     <em class="replaceable">
      <code>
       number_of_fixed_pages
      </code>
     </em>
     =
          fixed_elem_alloc_bytes / 32768
    </code>
    and
    <code class="literal">
     <em class="replaceable">
      <code>
       number_of_var_pages
      </code>
     </em>
     =
          var_elem_alloc_bytes / 32768
    </code>
    .
    <code class="literal">
     hash_index_alloc_bytes
    </code>
    is always a multiple
          of 8192 bytes, so
    <code class="literal">
     <em class="replaceable">
      <code>
       number_of_hash_pages
      </code>
     </em>
     =
          hash_index_alloc_bytes / 8192
    </code>
    .
   </p>
   <p>
    A fixed size page has an internal header and a number of
          fixed-size slots, each of which can contain one row's
          fixed-size part. The size of a given row's fixed size
          part is schema-dependent, and is provided by the
    <code class="literal">
     fixed_elem_size_bytes
    </code>
    column; the number of
          fixed-size slots per page can be determined by calculating the
          total number of slots and the total number of pages, like
          this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa33960448"><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"><em class="replaceable">fixed_slots</em> <span class="token operator">=</span> fixed_elem_count <span class="token operator">+</span> fixed_elem_free_count

<em class="replaceable">fixed_pages</em> <span class="token operator">=</span> fixed_elem_alloc_bytes <span class="token operator">/</span> 32768

<em class="replaceable">slots_per_page</em> <span class="token operator">=</span> total_slots <span class="token operator">/</span> total_pages</code></pre>
   </div>
   <p>
    <code class="literal">
     fixed_elem_count
    </code>
    is in effect the row count
          for a given table fragment, since each row has 1 fixed
          element,
    <code class="literal">
     fixed_elem_free_count
    </code>
    is the total
          number of free fixed-size slots across the allocated pages.
    <code class="literal">
     fixed_elem_free_bytes
    </code>
    is equal to
    <code class="literal">
     fixed_elem_free_count *
          fixed_elem_size_bytes
    </code>
    .
   </p>
   <p>
    A fragment can have any number of fixed-size pages; when the
          last row on a fixed-size page is deleted, the page is released
          to the
    <code class="literal">
     DataMemory
    </code>
    page pool. Fixed-size
          pages can be fragmented, with more pages allocated than is
          required by the number of fixed-size slots in use. You can
          check whether this is the case by comparing the pages required
          to the pages allocated, which you can calculate like this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa2306486"><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"><em class="replaceable">fixed_pages_required</em> <span class="token operator">=</span> 1 <span class="token operator">+</span> <span class="token punctuation">(</span>fixed_elem_count <span class="token operator">/</span> <em class="replaceable">slots_per_page</em><span class="token punctuation">)</span>

fixed_page_utilization <span class="token operator">=</span> <em class="replaceable">fixed_pages_required</em> <span class="token operator">/</span> <em class="replaceable">fixed_pages</em></code></pre>
   </div>
   <p>
    A variable-sized page has an internal header and uses the
          remaining space to store one or more variable-sized row parts;
          the number of parts stored depends on the schema and the
          actual data stored. Since not all schemas or rows have a
          variable-sized part,
    <code class="literal">
     var_elem_count
    </code>
    can be
          less than
    <code class="literal">
     fixed_elem_count
    </code>
    . The total free
          space available on all variable-sized pages in the fragment is
          shown by the
    <code class="literal">
     var_elem_free_bytes
    </code>
    column;
          because this space may be spread over multiple pages, it
          cannot necessarily be used to store an entry of a particular
          size. Each variable-sized page is reorganized as needed to fit
          the changing size of variable-sized row parts as they are
          inserted, updated, and deleted; if a given row part grows too
          large for the page it is in, it can be moved to a different
          page.
   </p>
   <p>
    Variable-sized page utilisation can be calculated as shown
          here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-simple"><div class="docs-select-all right" id="sa57233307"><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"><em class="replaceable">var_page_used_bytes</em> <span class="token operator">=</span>  var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes

<em class="replaceable">var_page_utilisation</em> <span class="token operator">=</span> var_page_used_bytes <span class="token operator">/</span> var_elem_alloc_bytes

<em class="replaceable">avg_row_var_part_size</em> <span class="token operator">=</span> <em class="replaceable">var_page_used_bytes</em> <span class="token operator">/</span> fixed_elem_count</code></pre>
   </div>
   <p>
    We can obtain the average variable part size per row like
          this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa20254537"><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"><em class="replaceable">avg_row_var_part_size</em> <span class="token operator">=</span> <em class="replaceable">var_page_used_bytes</em> <span class="token operator">/</span> fixed_elem_count</code></pre>
   </div>
   <p>
    Secondary unique indexes are implemented internally as
          independent tables with the following schema:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Primary key
        </em>
       </span>
       : Indexed columns in base
              table.
      </p>
     </li>
     <li class="listitem">
      <p>
       <span class="emphasis">
        <em>
         Values
        </em>
       </span>
       : Primary key columns from base
              table.
      </p>
     </li>
    </ul>
   </div>
   <p>
    These tables are distributed and fragmented as normal. This
          means that their fragment replicas use fixed, variable, and
          hash index pages as with any other
    <code class="literal">
     NDB
    </code>
    table.
   </p>
   <p>
    Secondary ordered indexes are fragmented and distributed in
          the same way as the base table. Ordered index fragments are
          T-tree structures which maintain a balanced tree containing
          row references in the order implied by the indexed columns.
          Since the tree contains references rather than actual data,
          the T-tree storage cost is not dependent on the size or number
          of indexed columns, but is rather a function of the number of
          rows. The tree is constructed using fixed-size node
          structures, each of which may contain a number of row
          references; the number of nodes required depends on the number
          of rows in the table, and the tree structure necessary to
          represent the ordering. In the
    <code class="literal">
     memory_per_fragment
    </code>
    table, we can see that
          ordered indexes allocate only fixed-size pages, so as usual
          the relevant columns from this table are as listed here:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        fixed_elem_alloc_bytes
       </code>
       : This is equal
              to 32768 times the number of fixed-size pages.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        fixed_elem_count
       </code>
       : The number of T-tree
              nodes in use.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        fixed_elem_size_bytes
       </code>
       : The number of
              bytes per T-tree node.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        fixed_elem_free_count
       </code>
       : The number of
              T-tree node slots available in the pages allocated.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        fixed_elem_free_bytes
       </code>
       : This is equal to
       <code class="literal">
        fixed_elem_free_count *
              fixed_elem_size_bytes
       </code>
       .
      </p>
     </li>
    </ul>
   </div>
   <p>
    If free space in a page is fragmented, the page is
          defragmented.
    <a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
     <code class="literal">
      OPTIMIZE TABLE
     </code>
    </a>
    can be used to defragment a table's variable-sized pages;
          this moves row variable-sized parts between pages so that some
          whole pages can be freed for re-use.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-cluster-ndbinfo-memory-per-fragment-examples">
       </a>
       memory_per_fragment Table: Examples
      </h5>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-memory-general" title="Getting general information about fragments and memory usage">
        Getting general information about fragments and memory usage
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-table-indexes" title="Finding a table and its indexes">
        Finding a table and its indexes
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-memory-allocated-per-element" title="Finding the memory allocated by schema elements">
        Finding the memory allocated by schema elements
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-table-indexes-all" title="Finding the memory allocated for a table and all indexes">
        Finding the memory allocated for a table and all indexes
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-per-row" title="Finding the memory allocated per row">
        Finding the memory allocated per row
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-in-use-per-row" title="Finding the total memory in use per row">
        Finding the total memory in use per row
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-allocated-per-element" title="Finding the memory allocated per element">
        Finding the memory allocated per element
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-allocated-per-row-by-element" title="Finding the average memory allocated per row, by element">
        Finding the average memory allocated per row, by element
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-allocated-per-row" title="Finding the average memory allocated per row">
        Finding the average memory allocated per row
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-allocated-per-row-for-table" title="Finding the average memory allocated per row for a table">
        Finding the average memory allocated per row for a table
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-in-use-per-element" title="Finding the memory in use by each schema element">
        Finding the memory in use by each schema element
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-avaerage-in-use-per-element" title="Finding the average memory in use by each schema element">
        Finding the average memory in use by each schema element
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-in-use-per-row-by-element" title="Finding the average memory in use per row, by element">
        Finding the average memory in use per row, by element
       </a>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-average-in-use-per-row" title="Finding the total average memory in use per row">
        Finding the total average memory in use per row
       </a>
      </p>
     </li>
    </ul>
   </div>
   <p>
    For the following examples, we create a simple table with
          three integer columns, one of which has a primary key, one
          having a unique index, and one with no indexes, as well as one
    <a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
     <code class="literal">
      VARCHAR
     </code>
    </a>
    column with no indexes,
          as shown here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa94110982"><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 prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">DATABASE</span> <span class="token keyword">IF</span> <span class="token operator">NOT</span> <span class="token keyword">EXISTS</span> test<span class="token punctuation">;</span>
<span class="token output">Query OK, 1 row affected (0.06 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">USE</span> test<span class="token punctuation">;</span>
<span class="token keyword">Database</span> <span class="token keyword">changed</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
<span class="token prompt">    -&gt;</span>    c1 <span class="token datatype">BIGINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>    c2 <span class="token datatype">INT</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>    c3 <span class="token datatype">INT</span> <span class="token keyword">UNIQUE</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</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 output">Query OK, 0 rows affected (0.27 sec)</span></code></pre>
   </div>
   <p>
    Following creation of the table, we insert 50,000 rows
          containing random data; the precise method of generating and
          inserting these rows makes no practical difference, and we
          leave the method of accomplishing as an exercise for the user.
   </p>
   <h6>
    <a name="memory-per-fragment-memory-general">
    </a>
    Getting general information about fragments and memory usage
   </h6>
   <p>
    This query shows general information about memory usage for
          each fragment:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64282494"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name<span class="token punctuation">,</span> node_id<span class="token punctuation">,</span> block_instance<span class="token punctuation">,</span> fragment_num<span class="token punctuation">,</span> fixed_elem_alloc_bytes<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   fixed_elem_free_bytes<span class="token punctuation">,</span> fixed_elem_size_bytes<span class="token punctuation">,</span> fixed_elem_count<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   fixed_elem_free_count<span class="token punctuation">,</span> var_elem_alloc_bytes<span class="token punctuation">,</span> var_elem_free_bytes<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   var_elem_count
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">"test/def/t1"</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
               fq_name<span class="token punctuation">:</span> test/def/t1
               node_id<span class="token punctuation">:</span> 5
        block_instance<span class="token punctuation">:</span> 1
          fragment_num<span class="token punctuation">:</span> 0
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
 fixed_elem_free_bytes<span class="token punctuation">:</span> 11836
 fixed_elem_size_bytes<span class="token punctuation">:</span> 44
      fixed_elem_count<span class="token punctuation">:</span> 24925
 fixed_elem_free_count<span class="token punctuation">:</span> 269
  var_elem_alloc_bytes<span class="token punctuation">:</span> 1245184
   var_elem_free_bytes<span class="token punctuation">:</span> 32552
        var_elem_count<span class="token punctuation">:</span> 24925
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 2. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
               fq_name<span class="token punctuation">:</span> test/def/t1
               node_id<span class="token punctuation">:</span> 5
        block_instance<span class="token punctuation">:</span> 1
          fragment_num<span class="token punctuation">:</span> 1
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
 fixed_elem_free_bytes<span class="token punctuation">:</span> 5236
 fixed_elem_size_bytes<span class="token punctuation">:</span> 44
      fixed_elem_count<span class="token punctuation">:</span> 25075
 fixed_elem_free_count<span class="token punctuation">:</span> 119
  var_elem_alloc_bytes<span class="token punctuation">:</span> 1277952
   var_elem_free_bytes<span class="token punctuation">:</span> 54232
        var_elem_count<span class="token punctuation">:</span> 25075
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 3. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
               fq_name<span class="token punctuation">:</span> test/def/t1
               node_id<span class="token punctuation">:</span> 6
        block_instance<span class="token punctuation">:</span> 1
          fragment_num<span class="token punctuation">:</span> 0
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
 fixed_elem_free_bytes<span class="token punctuation">:</span> 11836
 fixed_elem_size_bytes<span class="token punctuation">:</span> 44
      fixed_elem_count<span class="token punctuation">:</span> 24925
 fixed_elem_free_count<span class="token punctuation">:</span> 269
  var_elem_alloc_bytes<span class="token punctuation">:</span> 1245184
   var_elem_free_bytes<span class="token punctuation">:</span> 32552
        var_elem_count<span class="token punctuation">:</span> 24925
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 4. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
               fq_name<span class="token punctuation">:</span> test/def/t1
               node_id<span class="token punctuation">:</span> 6
        block_instance<span class="token punctuation">:</span> 1
          fragment_num<span class="token punctuation">:</span> 1
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
 fixed_elem_free_bytes<span class="token punctuation">:</span> 5236
 fixed_elem_size_bytes<span class="token punctuation">:</span> 44
      fixed_elem_count<span class="token punctuation">:</span> 25075
 fixed_elem_free_count<span class="token punctuation">:</span> 119
  var_elem_alloc_bytes<span class="token punctuation">:</span> 1277952
   var_elem_free_bytes<span class="token punctuation">:</span> 54232
        var_elem_count<span class="token punctuation">:</span> 25075
</span><span class="token output">4 rows in set (0.12 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-table-indexes">
    </a>
    Finding a table and its indexes
   </h6>
   <p>
    This query can be used to find a specific table and its
          indexes:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa91238365"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> fq_name
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> fq_name              <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.13 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> COUNT(*) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>    50000 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.00 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-memory-allocated-per-element">
    </a>
    Finding the memory allocated by schema elements
   </h6>
   <p>
    This query shows the memory allocated by each schema element
          (in total across all replicas):
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa36584843"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Name                 <span class="token punctuation">|</span> Fixed   <span class="token punctuation">|</span> Var     <span class="token punctuation">|</span> Hash    <span class="token punctuation">|</span> Total    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span> 4456448 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 10928128 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>  1966080 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>  1441792 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 3276800 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span>  4702208 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.11 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-table-indexes-all">
    </a>
    Finding the memory allocated for a table and all indexes
   </h6>
   <p>
    The sum of memory allocated for the table and all its indexes
          (in total across all replicas) can be obtained using the query
          shown here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80035681"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Fixed    <span class="token punctuation">|</span> Var     <span class="token punctuation">|</span> Hash    <span class="token punctuation">|</span> Total    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 11141120 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 2850816 <span class="token punctuation">|</span> 19038208 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
   </div>
   <p>
    This is an abbreviated version of the previous query which
          shows only the total memory used by the table:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64435497"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Total    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 19038208 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-total-per-row">
    </a>
    Finding the memory allocated per row
   </h6>
   <p>
    The following query shows the total memory allocated per row
          (across all replicas):
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa67195997"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total_alloc_per_row
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Total_alloc_per_row <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>            109.2813 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-total-in-use-per-row">
    </a>
    Finding the total memory in use per row
   </h6>
   <p>
    To obtain the total memory in use per row (across all
          replicas), we need the total memory used divided by the row
          count, which is the
    <code class="literal">
     fixed_elem_count
    </code>
    for
          the base table like this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa32700603"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt">    -&gt;</span>     <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> hash_index_alloc_bytes
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token keyword">AS</span> total_in_use_per_row
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> total_in_use_per_row <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>             107.2042 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-allocated-per-element">
    </a>
    Finding the memory allocated per element
   </h6>
   <p>
    The memory allocated by each schema element (in total across
          all replicas) can be found using the following query:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29148254"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">AS</span> Total_alloc
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Name                 <span class="token punctuation">|</span> Fixed   <span class="token punctuation">|</span> Var     <span class="token punctuation">|</span> Hash    <span class="token punctuation">|</span> Total_alloc <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span> 4456448 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span>    10928128 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>     1966080 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>     1441792 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 3276800 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span>     4702208 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.11 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-average-allocated-per-row-by-element">
    </a>
    Finding the average memory allocated per row, by element
   </h6>
   <p>
    To obtain the average memory allocated per row by each schema
          element (in total across all replicas), we use a subquery to
          get the base table fixed element count each time to get an
          average per row since
    <code class="literal">
     fixed_elem_count
    </code>
    for
          the indexes is not necessarily the same as for the base table,
          as shown here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa12825266"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Table_rows<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_fixed_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_var_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_hash_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_total_alloc
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">or</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Name                 <span class="token punctuation">|</span> Table_rows <span class="token punctuation">|</span> Avg_fixed_alloc <span class="token punctuation">|</span> Avg_var_alloc <span class="token punctuation">|</span> Avg_hash_alloc <span class="token punctuation">|</span> Avg_total_alloc <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         44.5645 <span class="token punctuation">|</span>       50.4627 <span class="token punctuation">|</span>        14.2541 <span class="token punctuation">|</span>        109.2813 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         19.6608 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>         0.0000 <span class="token punctuation">|</span>         19.6608 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         14.4179 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>         0.0000 <span class="token punctuation">|</span>         14.4179 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         32.7680 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>        14.2541 <span class="token punctuation">|</span>         47.0221 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.70 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-average-allocated-per-row">
    </a>
    Finding the average memory allocated per row
   </h6>
   <p>
    Average memory allocated per row (in total across all
          replicas):
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa2229160"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Table_rows<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_fixed_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_var_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_hash_alloc<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_total_alloc
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Table_rows <span class="token punctuation">|</span> Avg_fixed_alloc <span class="token punctuation">|</span> Avg_var_alloc <span class="token punctuation">|</span> Avg_hash_alloc <span class="token punctuation">|</span> Avg_total_alloc <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>        111.4112 <span class="token punctuation">|</span>       50.4627 <span class="token punctuation">|</span>        28.5082 <span class="token punctuation">|</span>        190.3821 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.71 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-allocated-per-row-for-table">
    </a>
    Finding the average memory allocated per row for a table
   </h6>
   <p>
    To get the average amount of memory allocated per row for the
          entire table across all replicas, we can use the query shown
          here:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa9219268"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_alloc
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_total_alloc <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>        190.3821 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.33 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-in-use-per-element">
    </a>
    Finding the memory in use by each schema element
   </h6>
   <p>
    To obtain the memory in use per schema element across all
          replicas, we need to sum the difference between allocated and
          free memory for each element, like this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64759478"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token operator">-</span>var_elem_free_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> var_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> hash_memory<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>  <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>       <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>       <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> total_alloc
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> fq_name              <span class="token punctuation">|</span> fixed_inuse <span class="token punctuation">|</span> var_inuse <span class="token punctuation">|</span> hash    <span class="token punctuation">|</span> total_alloc <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span>     4422304 <span class="token punctuation">|</span>   4872704 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span>    10720416 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span>     1950848 <span class="token punctuation">|</span>         0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>     1950848 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span>     1428736 <span class="token punctuation">|</span>         0 <span class="token punctuation">|</span>       0 <span class="token punctuation">|</span>     1428736 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span>     3212800 <span class="token punctuation">|</span>         0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span>     4638208 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.13 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-avaerage-in-use-per-element">
    </a>
    Finding the average memory in use by each schema element
   </h6>
   <p>
    This query gets the average memory in use per schema element
          across all replicas:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa75690478"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_var_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_hash<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt">    -&gt;</span>       <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span> <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_inuse
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Name                 <span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_fixed_inuse <span class="token punctuation">|</span> avg_var_inuse <span class="token punctuation">|</span> avg_hash <span class="token punctuation">|</span> avg_total_inuse <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> test/def/t1          <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         44.2230 <span class="token punctuation">|</span>       48.7270 <span class="token punctuation">|</span>  14.2541 <span class="token punctuation">|</span>        107.2042 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY   <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         19.5085 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>   0.0000 <span class="token punctuation">|</span>         19.5085 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3        <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         14.2874 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>   0.0000 <span class="token punctuation">|</span>         14.2874 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>         32.1280 <span class="token punctuation">|</span>        0.0000 <span class="token punctuation">|</span>  14.2541 <span class="token punctuation">|</span>         46.3821 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.72 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-average-in-use-per-row-by-element">
    </a>
    Finding the average memory in use per row, by element
   </h6>
   <p>
    This query gets the average memory in use per row, by element,
          across all replicas:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa33358374"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_var_inuse<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_hash<span class="token punctuation">,</span>
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt">    -&gt;</span>     <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_inuse
<span class="token prompt">    -&gt;</span>
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_fixed_inuse <span class="token punctuation">|</span> avg_var_inuse <span class="token punctuation">|</span> avg_hash <span class="token punctuation">|</span> avg_total_inuse <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>     100000 <span class="token punctuation">|</span>        110.1469 <span class="token punctuation">|</span>       48.7270 <span class="token punctuation">|</span>  28.5082 <span class="token punctuation">|</span>        187.3821 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.68 sec)</span></code></pre>
   </div>
   <h6>
    <a name="memory-per-fragment-total-average-in-use-per-row">
    </a>
    Finding the total average memory in use per row
   </h6>
   <p>
    This query obtains the total average memory in use, per row:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa53759505"><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 prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>   <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt">    -&gt;</span>     <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>     <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>   <span class="token operator">/</span>
<span class="token prompt">    -&gt;</span>   <span class="token punctuation">(</span> <span class="token keyword">SELECT</span>
<span class="token prompt">    -&gt;</span>       <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt">    -&gt;</span>       <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span>       <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_in_use
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt">    -&gt;</span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> avg_total_in_use <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>         187.3821 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.24 sec)</span></code></pre>
   </div>
  </div>
 </div>
 <br/>
</div>
