<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-gr-memory-monitoring-ps-sample-queries">
      </a>
      20.7.9.2 Example Queries
     </h4>
    </div>
   </div>
  </div>
  <p>
   This section describes sample queries using the instruments and
        events for monitoring Group Replication memory usage. The
        queries retrieve data from the
   <a class="link" href="performance-schema-memory-summary-tables.html" title="29.12.20.10 Memory Summary Tables">
    <code class="literal">
     memory_summary_global_by_event_name
    </code>
   </a>
   table.
  </p>
  <p>
   The memory data can be queried for individual events, for
        example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa73089173"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
<span class="token keyword">WHERE</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/write_set_encoded'</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>
                  EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/write_set_encoded
                 COUNT_ALLOC<span class="token punctuation">:</span> 1
                  COUNT_FREE<span class="token punctuation">:</span> 0
   SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">:</span> 45
    SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">:</span> 0
              LOW_COUNT_USED<span class="token punctuation">:</span> 0
          CURRENT_COUNT_USED<span class="token punctuation">:</span> 1
             HIGH_COUNT_USED<span class="token punctuation">:</span> 1
    LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 0
CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 45
   HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 45</span></code></pre>
  </div>
  <p>
   See
   <a class="xref" href="performance-schema-memory-summary-tables.html" title="29.12.20.10 Memory Summary Tables">
    Section 29.12.20.10, “Memory Summary Tables”
   </a>
   for more information on the columns.
  </p>
  <p>
   You can also define queries which sum various events to provide
        overviews of specific areas of memory usage.
  </p>
  <p>
   The following examples are described:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-transaction-capture" title="Memory Used to Capture Transactions">
       Memory Used to Capture Transactions
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-transaction-broadcast" title="Memory Used to Broadcast Transactions">
       Memory Used to Broadcast Transactions
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-total-memory" title="Total Memory Used in Group Replication">
       Total Memory Used in Group Replication
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-certification-memory" title="Memory Used in Certification">
       Memory Used in Certification
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-certification-memory" title="Memory Used in Certification">
       Memory Used in Certification
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-pipeline-memory" title="Memory Used in Replication Pipeline">
       Memory Used in Replication Pipeline
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-consistency-memory" title="Memory Used in Consistency">
       Memory Used in Consistency
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-message-memory" title="Memory Used in Delivery Message Service">
       Memory Used in Delivery Message Service
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="mysql-gr-memory-monitoring-ps-sample-queries.html#mysql-gr-memory-monitoring-ps-sample-queries-send-receive-transaction" title="Memory Used to Broadcast and Receive Transactions">
       Memory Used to Broadcast and Receive Transactions
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-transaction-capture">
       </a>
       Memory Used to Capture Transactions
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocated to capture user transactions is a sum of
          the
    <code class="literal">
     write_set_encoded
    </code>
    ,
    <code class="literal">
     write_set_extraction
    </code>
    , and
    <code class="literal">
     Log_event
    </code>
    event's values. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa83982330"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span><span class="token keyword">SELECT</span>
                <span class="token punctuation">(</span><span class="token operator">CASE</span>
                  <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/write_set_encoded'</span>
                  <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                  <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/sql/write_set_extraction'</span>
                  <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                  <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/sql/Log_event'</span>
                  <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                  <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> 
                <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/write_set_encoded'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/sql/write_set_extraction'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/sql/Log_event'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                          <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                       EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/memory_gr
                 SUM(COUNT_ALLOC)<span class="token punctuation">:</span> 127
                  SUM(COUNT_FREE)<span class="token punctuation">:</span> 117
   SUM(SUM_NUMBER_OF_BYTES_ALLOC)<span class="token punctuation">:</span> 54808
    SUM(SUM_NUMBER_OF_BYTES_FREE)<span class="token punctuation">:</span> 52051
              SUM(LOW_COUNT_USED)<span class="token punctuation">:</span> 0
          SUM(CURRENT_COUNT_USED)<span class="token punctuation">:</span> 10
             SUM(HIGH_COUNT_USED)<span class="token punctuation">:</span> 35
    SUM(LOW_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
SUM(CURRENT_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 2757
   SUM(HIGH_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 15630</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-transaction-broadcast">
       </a>
       Memory Used to Broadcast Transactions
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocated to broadcast transactions is a sum of the
    <code class="literal">
     Gcs_message_data::m_buffer
    </code>
    ,
    <code class="literal">
     transaction_data
    </code>
    , and
    <code class="literal">
     GCS_XCom::xcom_cache
    </code>
    event values. For
          example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa41526974"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span>  <span class="token string">'memory/group_rpl/Gcs_message_data::m_buffer'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/GCS_XCom::xcom_cache'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/transaction_data'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                  <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> 
                  <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span>  <span class="token string">'memory/group_rpl/Gcs_message_data::m_buffer'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/GCS_XCom::xcom_cache'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/transaction_data'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                          <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                       EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/memory_gr
                 SUM(COUNT_ALLOC)<span class="token punctuation">:</span> 84
                  SUM(COUNT_FREE)<span class="token punctuation">:</span> 31
   SUM(SUM_NUMBER_OF_BYTES_ALLOC)<span class="token punctuation">:</span> 1072324
    SUM(SUM_NUMBER_OF_BYTES_FREE)<span class="token punctuation">:</span> 7149
              SUM(LOW_COUNT_USED)<span class="token punctuation">:</span> 0
          SUM(CURRENT_COUNT_USED)<span class="token punctuation">:</span> 53
             SUM(HIGH_COUNT_USED)<span class="token punctuation">:</span> 59
    SUM(LOW_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
SUM(CURRENT_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1065175
   SUM(HIGH_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1065809</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-total-memory">
       </a>
       Total Memory Used in Group Replication
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocation to sending and receiving transactions,
          certification, and all other major processes. It is calculated
          by querying all the events of the
    <code class="literal">
     memory/group_rpl/
    </code>
    group. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa98828963"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/%'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                    <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> 
                    <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                    <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                 <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                 <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                              <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/%'</span>
                              <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                              <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                            <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                      EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/memory_gr
                SUM(COUNT_ALLOC)<span class="token punctuation">:</span> 190
                 SUM(COUNT_FREE)<span class="token punctuation">:</span> 127
  SUM(SUM_NUMBER_OF_BYTES_ALLOC)<span class="token punctuation">:</span> 1096370
   SUM(SUM_NUMBER_OF_BYTES_FREE)<span class="token punctuation">:</span> 28675
             SUM(LOW_COUNT_USED)<span class="token punctuation">:</span> 0
         SUM(CURRENT_COUNT_USED)<span class="token punctuation">:</span> 63
            SUM(HIGH_COUNT_USED)<span class="token punctuation">:</span> 77
   SUM(LOW_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
SUM(CURRENT_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1067695
  SUM(HIGH_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1069255</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-certification-memory">
       </a>
       Memory Used in Certification
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocation in the certification process is a sum of
          the
    <code class="literal">
     certification_data
    </code>
    ,
    <code class="literal">
     certification_data_gc
    </code>
    , and
    <code class="literal">
     certification_info
    </code>
    event values. For
          example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa40029251"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_data'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_data_gc'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_info'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                     <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                   <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_data'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_data_gc'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/certification_info'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/certification'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                         <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                      EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/certification
                SUM(COUNT_ALLOC)<span class="token punctuation">:</span> 80
                 SUM(COUNT_FREE)<span class="token punctuation">:</span> 80
  SUM(SUM_NUMBER_OF_BYTES_ALLOC)<span class="token punctuation">:</span> 9442
   SUM(SUM_NUMBER_OF_BYTES_FREE)<span class="token punctuation">:</span> 9442
             SUM(LOW_COUNT_USED)<span class="token punctuation">:</span> 0
         SUM(CURRENT_COUNT_USED)<span class="token punctuation">:</span> 0
            SUM(HIGH_COUNT_USED)<span class="token punctuation">:</span> 66
   SUM(LOW_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
SUM(CURRENT_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
  SUM(HIGH_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 6561</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-pipeline-memory">
       </a>
       Memory Used in Replication Pipeline
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocation of the replication pipeline is the sum
          of the
    <code class="literal">
     certification_data
    </code>
    and
    <code class="literal">
     transaction_data
    </code>
    event values. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa8610148"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/certification_data'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/pipeline'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/transaction_data'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/pipeline'</span>
                     <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                   <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                   <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                 <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                 <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/certification_data'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/pipeline'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">LIKE</span> <span class="token string">'memory/group_rpl/transaction_data'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/pipeline'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                          <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                 EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/pipeline
                COUNT_ALLOC<span class="token punctuation">:</span> 17
                 COUNT_FREE<span class="token punctuation">:</span> 13
  SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">:</span> 2483
   SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">:</span> 1668
             LOW_COUNT_USED<span class="token punctuation">:</span> 0
         CURRENT_COUNT_USED<span class="token punctuation">:</span> 4
            HIGH_COUNT_USED<span class="token punctuation">:</span> 4
   LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 0
CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 815
  HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 815</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-consistency-memory">
       </a>
       Memory Used in Consistency
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocation for transaction consistency guarantees
          is the sum of the
    <code class="literal">
     consistent_members_that_must_prepare_transaction
    </code>
    ,
    <code class="literal">
     consistent_transactions
    </code>
    ,
    <code class="literal">
     consistent_transactions_prepared
    </code>
    ,
    <code class="literal">
     consistent_transactions_waiting
    </code>
    , and
    <code class="literal">
     consistent_transactions_delayed_view_change
    </code>
    event values. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa90565248"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_members_that_must_prepare_transaction'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_prepared'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_waiting'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_delayed_view_change'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                     <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                   <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_members_that_must_prepare_transaction'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_prepared'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_waiting'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/consistent_transactions_delayed_view_change'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/consistency'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                          <span class="token keyword">END</span><span class="token punctuation">)</span>
                <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                  EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/consistency
                 COUNT_ALLOC<span class="token punctuation">:</span> 16
                  COUNT_FREE<span class="token punctuation">:</span> 6
   SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">:</span> 1464
    SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">:</span> 528
              LOW_COUNT_USED<span class="token punctuation">:</span> 0
          CURRENT_COUNT_USED<span class="token punctuation">:</span> 10
             HIGH_COUNT_USED<span class="token punctuation">:</span> 11
    LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 0
CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 936
   HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 1024</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-message-memory">
       </a>
       Memory Used in Delivery Message Service
      </h5>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     This instrumentation applies only to data received, not data
            sent.
    </p>
   </div>
   <p>
    The memory allocation for the Group Replication delivery
          message service is the sum of the
    <code class="literal">
     message_service_received_message
    </code>
    and
    <code class="literal">
     message_service_queue
    </code>
    event values. For
          example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa26083931"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/message_service_received_message'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/message_service'</span>
                     <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/message_service_queue'</span>
                     <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/message_service'</span>
                     <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                  <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> 
                  <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/message_service_received_message'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/message_service'</span>
                            <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/message_service_queue'</span>
                            <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/message_service'</span>
                            <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                          <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                 EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/message_service
                COUNT_ALLOC<span class="token punctuation">:</span> 2
                 COUNT_FREE<span class="token punctuation">:</span> 0
  SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">:</span> 1048664
   SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">:</span> 0
             LOW_COUNT_USED<span class="token punctuation">:</span> 0
         CURRENT_COUNT_USED<span class="token punctuation">:</span> 2
            HIGH_COUNT_USED<span class="token punctuation">:</span> 2
   LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 0
CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 1048664
  HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">:</span> 1048664</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-gr-memory-monitoring-ps-sample-queries-send-receive-transaction">
       </a>
       Memory Used to Broadcast and Receive Transactions
      </h5>
     </div>
    </div>
   </div>
   <p>
    The memory allocation for the broadcasting and receiving
          transactions to and from the network is the sum of the
    <code class="literal">
     wGcs_message_data::m_buffer
    </code>
    and
    <code class="literal">
     GCS_XCom::xcom_cache
    </code>
    event values. For
          example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96936672"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>
                <span class="token keyword">SELECT</span>
                  <span class="token punctuation">(</span><span class="token operator">CASE</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/Gcs_message_data::m_buffer'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/GCS_XCom::xcom_cache'</span>
                    <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                    <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                  <span class="token keyword">END</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> EVENT_NAME<span class="token punctuation">,</span> 
                  <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>COUNT_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_ALLOC<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>SUM_NUMBER_OF_BYTES_FREE<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_COUNT_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>LOW_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">SUM</span><span class="token punctuation">(</span>CURRENT_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span><span class="token punctuation">,</span>
                  <span class="token function">SUM</span><span class="token punctuation">(</span>HIGH_NUMBER_OF_BYTES_USED<span class="token punctuation">)</span>
                <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>memory_summary_global_by_event_name
                <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> <span class="token punctuation">(</span><span class="token operator">CASE</span>
                           <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/Gcs_message_data::m_buffer'</span>
                           <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                           <span class="token keyword">WHEN</span> EVENT_NAME <span class="token operator">=</span> <span class="token string">'memory/group_rpl/GCS_XCom::xcom_cache'</span>
                           <span class="token keyword">THEN</span> <span class="token string">'memory/group_rpl/memory_gr'</span>
                           <span class="token keyword">ELSE</span> <span class="token string">'memory_gr_rest'</span>
                         <span class="token keyword">END</span><span class="token punctuation">)</span>
              <span class="token punctuation">)</span> f
<span class="token keyword">WHERE</span> f<span class="token punctuation">.</span>EVENT_NAME <span class="token operator">!=</span> <span class="token string">'memory_gr_rest'</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>
                      EVENT_NAME<span class="token punctuation">:</span> memory/group_rpl/memory_gr
                SUM(COUNT_ALLOC)<span class="token punctuation">:</span> 73
                 SUM(COUNT_FREE)<span class="token punctuation">:</span> 20
  SUM(SUM_NUMBER_OF_BYTES_ALLOC)<span class="token punctuation">:</span> 1070845
   SUM(SUM_NUMBER_OF_BYTES_FREE)<span class="token punctuation">:</span> 5670
             SUM(LOW_COUNT_USED)<span class="token punctuation">:</span> 0
         SUM(CURRENT_COUNT_USED)<span class="token punctuation">:</span> 53
            SUM(HIGH_COUNT_USED)<span class="token punctuation">:</span> 56
   SUM(LOW_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 0
SUM(CURRENT_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1065175
  SUM(HIGH_NUMBER_OF_BYTES_USED)<span class="token punctuation">:</span> 1065175</span></code></pre>
   </div>
  </div>
 </div>
 <br/>
</div>
