<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="sys-ps-statement-avg-latency-histogram">
      </a>
      30.4.4.21 The ps_statement_avg_latency_histogram() Procedure
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045061307392">
  </a>
  <a class="indexterm" name="idm46045061305872">
  </a>
  <p>
   Displays a textual histogram graph of the average latency
          values across all normalized statements tracked within the
          Performance Schema
   <a class="link" href="performance-schema-statement-summary-tables.html" title="29.12.20.3 Statement Summary Tables">
    <code class="literal">
     events_statements_summary_by_digest
    </code>
   </a>
   table.
  </p>
  <p>
   This procedure can be used to display a very high-level
          picture of the latency distribution of statements running
          within this MySQL instance.
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="sys-ps-statement-avg-latency-histogram-parameters">
       </a>
       Parameters
      </h5>
     </div>
    </div>
   </div>
   <p>
    None.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="sys-ps-statement-avg-latency-histogram-example">
       </a>
       Example
      </h5>
     </div>
    </div>
   </div>
   <p>
    The histogram output in statement units. For example,
    <code class="literal">
     * = 2 units
    </code>
    in the histogram legend means
            that each
    <code class="literal">
     *
    </code>
    character represents 2
            statements.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa1173718"><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">CALL</span> sys<span class="token punctuation">.</span>ps_statement_avg_latency_histogram<span class="token punctuation">(</span><span class="token punctuation">)</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>
Performance Schema Statement Digest Average Latency Histogram<span class="token punctuation">:</span>

  . = 1 unit
  <span class="token punctuation">*</span> = 2 units
  # = 3 units

(0 - 66ms)     88  | #############################
(66 - 133ms)   14  | ..............
(133 - 199ms)  4   | ....
(199 - 265ms)  5   | <span class="token punctuation">*</span><span class="token punctuation">*</span>
(265 - 332ms)  1   | .
(332 - 398ms)  0   |
(398 - 464ms)  1   | .
(464 - 531ms)  0   |
(531 - 597ms)  0   |
(597 - 663ms)  0   |
(663 - 730ms)  0   |
(730 - 796ms)  0   |
(796 - 863ms)  0   |
(863 - 929ms)  0   |
(929 - 995ms)  0   |
(995 - 1062ms) 0   |

  Total Statements<span class="token punctuation">:</span> 114; Buckets<span class="token punctuation">:</span> 16; Bucket Size<span class="token punctuation">:</span> 66 ms;</span></code></pre>
   </div>
  </div>
 </div>
 <br/>
</div>
