<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="tracing-example">
      </a>
      10.15.12 Example
     </h3>
    </div>
   </div>
  </div>
  <p>
   Here we take an example from the test suite.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68191585"><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 comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Tracing of ORDER BY &amp; GROUP BY simplification.</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token keyword">SET</span> optimizer_trace<span class="token operator">=</span><span class="token string">"enabled=on"</span><span class="token punctuation">,</span>end_markers_in_json<span class="token operator">=</span><span class="token keyword">on</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># make readable</span>
<span class="token keyword">SET</span> optimizer_trace_max_mem_size<span class="token operator">=</span><span class="token number">1000000</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true"># avoid small default</span>

<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
  pk <span class="token datatype">INT</span><span class="token punctuation">,</span> col_int_key <span class="token datatype">INT</span><span class="token punctuation">,</span>
  col_varchar_key <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> 
  col_varchar_nokey <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">VALUES</span>
  <span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">11</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">12</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">13</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">14</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">15</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">17</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">18</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'a'</span><span class="token punctuation">,</span><span class="token string">'a'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">21</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">22</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">23</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">204</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">25</span><span class="token punctuation">,</span><span class="token number">224</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">26</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'e'</span><span class="token punctuation">,</span><span class="token string">'e'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">27</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">28</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">29</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t2 <span class="token punctuation">(</span>
  pk <span class="token datatype">INT</span><span class="token punctuation">,</span> col_int_key <span class="token datatype">INT</span><span class="token punctuation">,</span>
  col_varchar_key <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> 
  col_varchar_nokey <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>pk<span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t2 <span class="token keyword">VALUES</span>
  <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'e'</span><span class="token punctuation">,</span><span class="token string">'e'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token number">188</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">11</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">12</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">13</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">14</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">15</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">17</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">18</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">19</span><span class="token punctuation">,</span><span class="token number">231</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">21</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">22</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">23</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">25</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">26</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">27</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">28</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">29</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">30</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">31</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">32</span><span class="token punctuation">,</span><span class="token number">194</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">33</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">,</span><span class="token string">'i'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">34</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">35</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">36</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">37</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">38</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">39</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'a'</span><span class="token punctuation">,</span><span class="token string">'a'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">40</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">41</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">42</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">43</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">44</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">,</span><span class="token string">'r'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">45</span><span class="token punctuation">,</span><span class="token number">98</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">46</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">47</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">48</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">49</span><span class="token punctuation">,</span><span class="token number">189</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">51</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">52</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">53</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">54</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">55</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">56</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">,</span><span class="token string">'n'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">57</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">58</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">59</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">,</span><span class="token string">'s'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">60</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">,</span><span class="token string">'j'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">61</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">62</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">63</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">64</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">65</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'f'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">66</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">67</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">68</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">69</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">,</span><span class="token string">'x'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">70</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">71</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">72</span><span class="token punctuation">,</span><span class="token number">120</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">,</span><span class="token string">'q'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">73</span><span class="token punctuation">,</span><span class="token number">25</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">74</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">75</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">,</span><span class="token string">'l'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">76</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">,</span><span class="token string">'w'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">77</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">,</span><span class="token string">'h'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">78</span><span class="token punctuation">,</span><span class="token number">153</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">79</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">80</span><span class="token punctuation">,</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">81</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">,</span><span class="token string">'v'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">82</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">83</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">,</span><span class="token string">'d'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">,</span><span class="token string">'p'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">85</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">86</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">87</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">88</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">,</span><span class="token string">'y'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">89</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">90</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">,</span><span class="token string">'c'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">91</span><span class="token punctuation">,</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">,</span><span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">92</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">93</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">94</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">95</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">,</span><span class="token string">'t'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token punctuation">(</span><span class="token number">96</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">,</span><span class="token string">'k'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">97</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">,</span><span class="token string">'u'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">98</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">,</span><span class="token string">'b'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">99</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token string">'m'</span><span class="token punctuation">,</span><span class="token string">'m'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">,</span><span class="token string">'o'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>alias2<span class="token punctuation">.</span>col_varchar_nokey<span class="token punctuation">)</span> <span class="token keyword">AS</span> c1<span class="token punctuation">,</span> alias2<span class="token punctuation">.</span>pk <span class="token keyword">AS</span> c2 
  <span class="token keyword">FROM</span> t1 <span class="token keyword">AS</span> alias1
  <span class="token keyword">STRAIGHT_JOIN</span> t2 <span class="token keyword">AS</span> alias2 
  <span class="token keyword">ON</span> alias2<span class="token punctuation">.</span>pk <span class="token operator">=</span> alias1<span class="token punctuation">.</span>col_int_key 
  <span class="token keyword">WHERE</span> alias1<span class="token punctuation">.</span>pk
  <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> c2 
  <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> alias1<span class="token punctuation">.</span>col_int_key<span class="token punctuation">,</span> alias2<span class="token punctuation">.</span>pk<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>
<span class="token output"><span class="token punctuation">|</span> c1   <span class="token punctuation">|</span> c2 <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>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  4 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  6 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    0 <span class="token punctuation">|</span>  9 <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></code></pre>
  </div>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    For reference, the complete trace is shown uninterrupted at the
        end of this section.
   </p>
  </div>
  <p>
   Now we can examine the trace, whose first column
      (
   <code class="literal">
    QUERY
   </code>
   ), containing the original statement to
      be traced, is shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa58180463"><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> INFORMATION_SCHEMA<span class="token punctuation">.</span>OPTIMIZER_TRACE\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>
QUERY<span class="token punctuation">:</span> SELECT SUM(alias2.col_varchar_nokey) AS c1, alias2.pk AS c2 
  FROM t1 AS alias1
  STRAIGHT_JOIN t2 AS alias2 
  ON alias2.pk = alias1.col_int_key 
  WHERE alias1.pk
  GROUP BY c2 
  ORDER BY alias1.col_int_key, alias2.pk</span></code></pre>
  </div>
  <p>
   This can be useful mark when several traces are stored.
  </p>
  <p>
   The
   <code class="literal">
    TRACE
   </code>
   column begins by showing that
      execution of the statement is made up of discrete steps, like
      this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa97257171"><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-json"><span class="token property">"steps"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
  <span class="token punctuation">{</span></code></pre>
  </div>
  <p>
   This is followed by the preparation of the join for the first (and
      only)
   <code class="literal">
    SELECT
   </code>
   in the statement being traced, as
      shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa79360040"><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-json"><span class="token property">"steps"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
  <span class="token punctuation">{</span>
    <span class="token property">"expanded_query"</span><span class="token operator">:</span> "/* select#<span class="token number">1</span> */ select \
       sum(`test`.`alias2`.`col_varchar_nokey`<span class="token punctuation">)</span> AS \ 
       `SUM(alias2.col_varchar_nokey<span class="token punctuation">)</span>`<span class="token punctuation">,</span>`test`.`alias2`.`pk` AS `field2` \
       from (`test`.`t1` `alias1` straight_join `test`.`t2` `alias2` \ 
       on((`test`.`alias2`.`pk` = `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> \
       where `test`.`alias1`.`pk` \
       group by `test`.`alias2`.`pk` \
       order by `test`.`alias1`.`col_int_key`<span class="token punctuation">,</span>`test`.`alias2`.`pk`"
   <span class="token punctuation">}</span>
<span class="token punctuation">]</span> /* steps */
       <span class="token punctuation">}</span> /* join_preparation */
     <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   The output just shown displays the query as it is used for
      preparing the join; all columns (fields) have been resolved to
      their databases and tables, and each
   <code class="literal">
    SELECT
   </code>
   is
      annotated with a sequence number, which can be useful when
      studying subqueries.
  </p>
  <p>
   The next portion of the trace shows how the join is optimized,
      starting with condition processing:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa38669054"><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-json">     <span class="token punctuation">{</span>
      <span class="token property">"join_optimization"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
               <span class="token property">"select#"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
               <span class="token property">"steps"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                 <span class="token punctuation">{</span>
                   <span class="token property">"condition_processing"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                     <span class="token property">"condition"</span><span class="token operator">:</span> <span class="token string">"WHERE"</span><span class="token punctuation">,</span>
                     <span class="token property">"original_condition"</span><span class="token operator">:</span> "(`test`.`alias1`.`pk` and \
                     (`test`.`alias2`.`pk` = `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span><span class="token punctuation">)</span>"<span class="token punctuation">,</span>
                     <span class="token property">"steps"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                       <span class="token punctuation">{</span>
                         <span class="token property">"transformation"</span><span class="token operator">:</span> <span class="token string">"equality_propagation"</span><span class="token punctuation">,</span>
                         <span class="token property">"resulting_condition"</span><span class="token operator">:</span> "(`test`.`alias1`.`pk` and \
                         multiple equal(`test`.`alias2`.`pk`<span class="token punctuation">,</span> \
                         `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span><span class="token punctuation">)</span>"
                       <span class="token punctuation">}</span><span class="token punctuation">,</span>
                       <span class="token punctuation">{</span>
                         <span class="token property">"transformation"</span><span class="token operator">:</span> <span class="token string">"constant_propagation"</span><span class="token punctuation">,</span>
                         <span class="token property">"resulting_condition"</span><span class="token operator">:</span> "(`test`.`alias1`.`pk` and \
                         multiple equal(`test`.`alias2`.`pk`<span class="token punctuation">,</span> \
                         `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span><span class="token punctuation">)</span>"
                       <span class="token punctuation">}</span><span class="token punctuation">,</span>
                       <span class="token punctuation">{</span>
                         <span class="token property">"transformation"</span><span class="token operator">:</span> <span class="token string">"trivial_condition_removal"</span><span class="token punctuation">,</span>
                         <span class="token property">"resulting_condition"</span><span class="token operator">:</span> "(`test`.`alias1`.`pk` and \
                         multiple equal(`test`.`alias2`.`pk`<span class="token punctuation">,</span> \
                         `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span><span class="token punctuation">)</span>"
                 <span class="token punctuation">}</span>
               <span class="token punctuation">]</span> /* steps */
             <span class="token punctuation">}</span> /* condition_processing */
           <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   Next, the optimizer checks for possible
   <code class="literal">
    ref
   </code>
   accesses, and identifies one:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa88339953"><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-json">           <span class="token punctuation">{</span>
             <span class="token property">"ref_optimizer_key_uses"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias2"</span><span class="token punctuation">,</span>
                 <span class="token property">"field"</span><span class="token operator">:</span> <span class="token string">"pk"</span><span class="token punctuation">,</span>
                 <span class="token property">"equals"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias1`.`col_int_key`"</span><span class="token punctuation">,</span>
                 <span class="token property">"null_rejecting"</span><span class="token operator">:</span> <span class="token boolean">true</span>
              <span class="token punctuation">}</span>
           <span class="token punctuation">]</span> /* ref_optimizer_key_uses */
         <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   A
   <code class="literal">
    ref
   </code>
   access which rejects
   <code class="literal">
    NULL
   </code>
   has been identified: no
   <code class="literal">
    NULL
   </code>
   in
   <code class="literal">
    test.alias1.col_int_key
   </code>
   can have a match.
      (Observe that it could have a match, were the operator a null-safe
      equals
   <a class="link" href="comparison-operators.html#operator_equal-to">
    <code class="literal">
     &lt;=&gt;
    </code>
   </a>
   ).
  </p>
  <p>
   Next, for every table in the query, we estimate the cost of, and
      number of records returned by, a table scan or a range access.
  </p>
  <p>
   We need to find an optimal order for the tables. Normally, greedy
      search is used, but since the statement uses a straight join, only
      the requested order is explored, and one or more access methods
      are selected. As shown in this portion of the trace, we can choose
      a table scan:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa1430566"><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-json">           <span class="token punctuation">{</span>
<span class="token property">"records_estimation"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias1"</span><span class="token punctuation">,</span>
                 <span class="token property">"const_keys_added"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                   <span class="token property">"keys"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                   <span class="token punctuation">]</span> /* keys */<span class="token punctuation">,</span>
                   <span class="token property">"cause"</span><span class="token operator">:</span> <span class="token string">"group_by"</span>
                 <span class="token punctuation">}</span> /* const_keys_added */<span class="token punctuation">,</span>
                 <span class="token property">"range_analysis"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                   <span class="token property">"table_scan"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                     <span class="token property">"records"</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
                     <span class="token property">"cost"</span><span class="token operator">:</span> <span class="token number">8.1977</span>
                   <span class="token punctuation">}</span> /* table_scan */
                 <span class="token punctuation">}</span> /* range_analysis */
               <span class="token punctuation">}</span><span class="token punctuation">,</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias2"</span><span class="token punctuation">,</span>
                 <span class="token property">"const_keys_added"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                   <span class="token property">"keys"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                     <span class="token string">"PRIMARY"</span>
                   <span class="token punctuation">]</span> /* keys */<span class="token punctuation">,</span>
                   <span class="token property">"cause"</span><span class="token operator">:</span> <span class="token string">"group_by"</span>
                 <span class="token punctuation">}</span> /* const_keys_added */<span class="token punctuation">,</span>
                 <span class="token property">"range_analysis"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                   <span class="token property">"table_scan"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                     <span class="token property">"records"</span><span class="token operator">:</span> <span class="token number">100</span><span class="token punctuation">,</span>
                     <span class="token property">"cost"</span><span class="token operator">:</span> <span class="token number">24.588</span>
                   <span class="token punctuation">}</span> /* table_scan */<span class="token punctuation">,</span>
                   <span class="token property">"potential_range_indices"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                     <span class="token punctuation">{</span>
                       <span class="token property">"index"</span><span class="token operator">:</span> <span class="token string">"PRIMARY"</span><span class="token punctuation">,</span>
                       <span class="token property">"usable"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
                       <span class="token property">"key_parts"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                         <span class="token string">"pk"</span>
                       <span class="token punctuation">]</span> /* key_parts */
                     <span class="token punctuation">}</span>
                   <span class="token punctuation">]</span> /* potential_range_indices */<span class="token punctuation">,</span>
                   <span class="token property">"setup_range_conditions"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                   <span class="token punctuation">]</span> /* setup_range_conditions */<span class="token punctuation">,</span>
                   <span class="token property">"group_index_range"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                     <span class="token property">"chosen"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
                     <span class="token property">"cause"</span><span class="token operator">:</span> <span class="token string">"not_single_table"</span> 
                      <span class="token punctuation">}</span> /* group_index_range */ 
                <span class="token punctuation">}</span> /* range_analysis */
               <span class="token punctuation">}</span>
             <span class="token punctuation">]</span> /* records_estimation */
           <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   As just shown in the second portion of the range analysis, it is
      not possible to use
   <code class="literal">
    GROUP_MIN_MAX
   </code>
   because it
      accepts only one table, and we have two in the join. This means
      that no range access is possible.
  </p>
  <p>
   The optimizer estimates that reading the first table, and applying
      any required conditions to it, yields 20 rows:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa40664465"><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-json">           <span class="token punctuation">{</span>
<span class="token property">"considered_execution_plans"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias1"</span><span class="token punctuation">,</span>
                 <span class="token property">"best_access_path"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                   <span class="token property">"considered_access_paths"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                     <span class="token punctuation">{</span>
                       <span class="token property">"access_type"</span><span class="token operator">:</span> <span class="token string">"scan"</span><span class="token punctuation">,</span>
                       <span class="token property">"records"</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
                       <span class="token property">"cost"</span><span class="token operator">:</span> <span class="token number">2.0977</span><span class="token punctuation">,</span>
                       <span class="token property">"chosen"</span><span class="token operator">:</span> <span class="token boolean">true</span>
                     <span class="token punctuation">}</span>
                   <span class="token punctuation">]</span> /* considered_access_paths */
                 <span class="token punctuation">}</span> /* best_access_path */<span class="token punctuation">,</span>
                 <span class="token property">"cost_for_plan"</span><span class="token operator">:</span> <span class="token number">6.0977</span><span class="token punctuation">,</span>
                 <span class="token property">"records_for_plan"</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   For
   <code class="literal">
    alias2
   </code>
   , we choose
   <code class="literal">
    ref
   </code>
   access on the primary key rather than a table scan, because the
      number of records returned by the latter (75) is far greater than
      that returned by
   <code class="literal">
    ref
   </code>
   access (1), as shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa24685888"><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-json">                 <span class="token property">"rest_of_plan"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                   <span class="token punctuation">{</span>
                     <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                     <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias2"</span><span class="token punctuation">,</span>
                     <span class="token property">"best_access_path"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                       <span class="token property">"considered_access_paths"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                         <span class="token punctuation">{</span>
                           <span class="token property">"access_type"</span><span class="token operator">:</span> <span class="token string">"ref"</span><span class="token punctuation">,</span>
                           <span class="token property">"index"</span><span class="token operator">:</span> <span class="token string">"PRIMARY"</span><span class="token punctuation">,</span>
                           <span class="token property">"records"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
                           <span class="token property">"cost"</span><span class="token operator">:</span> <span class="token number">20.2</span><span class="token punctuation">,</span>
                           <span class="token property">"chosen"</span><span class="token operator">:</span> <span class="token boolean">true</span>
                         <span class="token punctuation">}</span><span class="token punctuation">,</span>
                         <span class="token punctuation">{</span>
                           <span class="token property">"access_type"</span><span class="token operator">:</span> <span class="token string">"scan"</span><span class="token punctuation">,</span>
                           <span class="token property">"using_join_cache"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
                           <span class="token property">"records"</span><span class="token operator">:</span> <span class="token number">75</span><span class="token punctuation">,</span>
                           <span class="token property">"cost"</span><span class="token operator">:</span> <span class="token number">7.4917</span><span class="token punctuation">,</span>
                           <span class="token property">"chosen"</span><span class="token operator">:</span> <span class="token boolean">false</span>
                         <span class="token punctuation">}</span>
                       <span class="token punctuation">]</span> /* considered_access_paths */
                     <span class="token punctuation">}</span> /* best_access_path */<span class="token punctuation">,</span>
                     <span class="token property">"cost_for_plan"</span><span class="token operator">:</span> <span class="token number">30.098</span><span class="token punctuation">,</span>
                     <span class="token property">"records_for_plan"</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
                     <span class="token property">"chosen"</span><span class="token operator">:</span> <span class="token boolean">true</span>
                   <span class="token punctuation">}</span>
                 <span class="token punctuation">]</span> /* rest_of_plan */
               <span class="token punctuation">}</span>
             <span class="token punctuation">]</span> /* considered_execution_plans */
           <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   Now that the order of tables is fixed, we can split the
   <code class="literal">
    WHERE
   </code>
   condition into chunks which can be tested
      early (pushdown of conditions down the join tree):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa57014511"><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-json">           <span class="token punctuation">{</span>
              <span class="token property">"attaching_conditions_to_tables"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">"original_condition"</span><span class="token operator">:</span> "((`test`.`alias2`.`pk` = \
                `test`.`alias1`.`col_int_key`<span class="token punctuation">)</span> and `test`.`alias1`.`pk`<span class="token punctuation">)</span>"<span class="token punctuation">,</span>
                <span class="token property">"attached_conditions_computation"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                <span class="token punctuation">]</span> /* attached_conditions_computation */<span class="token punctuation">,</span>
                <span class="token property">"attached_conditions_summary"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                  <span class="token punctuation">{</span>
                    <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                    <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias1"</span><span class="token punctuation">,</span>
                    <span class="token property">"attached"</span><span class="token operator">:</span> "(`test`.`alias1`.`pk` and \
                    (`test`.`alias1`.`col_int_key` is not <span class="token null">null</span><span class="token punctuation">)</span><span class="token punctuation">)</span>"
           <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   This condition can be tested on rows of
   <code class="literal">
    alias1
   </code>
   without reading rows from
   <code class="literal">
    alias2
   </code>
   .
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa88207034"><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-json">                 <span class="token punctuation">{</span>
                   <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                   <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias2"</span><span class="token punctuation">,</span>
                   <span class="token property">"attached"</span><span class="token operator">:</span> <span class="token null">null</span>
                 <span class="token punctuation">}</span>
               <span class="token punctuation">]</span> /* attached_conditions_summary */
             <span class="token punctuation">}</span> /* attaching_conditions_to_tables */
           <span class="token punctuation">}</span><span class="token punctuation">,</span>
           <span class="token punctuation">{</span></code></pre>
  </div>
  <p>
   Now we try to simplify the
   <code class="literal">
    ORDER BY
   </code>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa34065964"><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-json">              <span class="token property">"clause_processing"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
               <span class="token property">"clause"</span><span class="token operator">:</span> <span class="token string">"ORDER BY"</span><span class="token punctuation">,</span>
               <span class="token property">"original_clause"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias1`.`col_int_key`,`test`.`alias2`.`pk`"</span><span class="token punctuation">,</span>
               <span class="token property">"items"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                 <span class="token punctuation">{</span>
                   <span class="token property">"item"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias1`.`col_int_key`"</span>
                 <span class="token punctuation">}</span><span class="token punctuation">,</span>
                 <span class="token punctuation">{</span>
                   <span class="token property">"item"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias2`.`pk`"</span><span class="token punctuation">,</span>
                   <span class="token property">"eq_ref_to_preceding_items"</span><span class="token operator">:</span> <span class="token boolean">true</span>
                 <span class="token punctuation">}</span>
               <span class="token punctuation">]</span> /* items */<span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   Because the
   <code class="literal">
    WHERE
   </code>
   clause contains
   <code class="literal">
    alias2.pk=alias1.col_int_key
   </code>
   , ordering by both
      columns is unnecessary; we can order by the first column alone,
      since the second column is always equal to it.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa20005114"><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-json">               <span class="token property">"resulting_clause_is_simple"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
               <span class="token property">"resulting_clause"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias1`.`col_int_key`"</span>
              <span class="token punctuation">}</span> /* clause_processing */
           <span class="token punctuation">}</span><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   The shorter
   <code class="literal">
    ORDER BY
   </code>
   clause (which is not
      visible in in the output of
   <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
    <code class="literal">
     EXPLAIN
    </code>
   </a>
   ) can be implemented as an
      index scan, since it uses only a single column of one table.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa87546427"><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-json">           <span class="token punctuation">{</span>
             <span class="token property">"clause_processing"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
               <span class="token property">"clause"</span><span class="token operator">:</span> <span class="token string">"GROUP BY"</span><span class="token punctuation">,</span>
               <span class="token property">"original_clause"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias2`.`pk`"</span><span class="token punctuation">,</span>
               <span class="token property">"items"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
                 <span class="token punctuation">{</span>
                   <span class="token property">"item"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias2`.`pk`"</span>
                 <span class="token punctuation">}</span>
               <span class="token punctuation">]</span> /* items */<span class="token punctuation">,</span>
               <span class="token property">"resulting_clause_is_simple"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
               <span class="token property">"resulting_clause"</span><span class="token operator">:</span> <span class="token string">"`test`.`alias2`.`pk`"</span>
             <span class="token punctuation">}</span> /* clause_processing */
           <span class="token punctuation">}</span><span class="token punctuation">,</span>
           <span class="token punctuation">{</span>
             <span class="token property">"refine_plan"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias1"</span><span class="token punctuation">,</span>
                 <span class="token property">"scan_type"</span><span class="token operator">:</span> <span class="token string">"table"</span>
               <span class="token punctuation">}</span><span class="token punctuation">,</span>
               <span class="token punctuation">{</span>
                 <span class="token property">"database"</span><span class="token operator">:</span> <span class="token string">"test"</span><span class="token punctuation">,</span>
                 <span class="token property">"table"</span><span class="token operator">:</span> <span class="token string">"alias2"</span>
               <span class="token punctuation">}</span>
             <span class="token punctuation">]</span> /* refine_plan */
           <span class="token punctuation">}</span>
         <span class="token punctuation">]</span> /* steps */
       <span class="token punctuation">}</span> /* join_optimization */
     <span class="token punctuation">}</span><span class="token punctuation">,</span>
     <span class="token punctuation">{</span></code></pre>
  </div>
  <p>
   Now the join is executed:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-json"><div class="docs-select-all right" id="sa31884331"><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-json">       <span class="token property">"join_execution"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
         <span class="token property">"select#"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
         <span class="token property">"steps"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
         <span class="token punctuation">]</span> /* steps */
       <span class="token punctuation">}</span> /* join_execution */
     <span class="token punctuation">}</span>
   <span class="token punctuation">]</span> /* steps */
 <span class="token punctuation">}</span>	<span class="token number">0</span>	<span class="token number">0</span></code></pre>
  </div>
  <p>
   All traces have the same basic structure. If a statement uses
      subqueries, there can be mutliple preparations, optimizations, and
      executions, as well as subquery-specific transformations.
  </p>
  <p>
   The complete trace is shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89973585"><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 operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>OPTIMIZER_TRACE\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>
                            QUERY<span class="token punctuation">:</span> SELECT SUM(alias2.col_varchar_nokey) AS c1, alias2.pk AS c2 
  FROM t1 AS alias1
  STRAIGHT_JOIN t2 AS alias2 
  ON alias2.pk = alias1.col_int_key 
  WHERE alias1.pk
  GROUP BY c2 
  ORDER BY alias1.col_int_key, alias2.pk
                            TRACE<span class="token punctuation">:</span> {
  "steps"<span class="token punctuation">:</span> [
    {
      "join_preparation"<span class="token punctuation">:</span> {
        "select#"<span class="token punctuation">:</span> 1,
        "steps"<span class="token punctuation">:</span> [
          {
            "expanded_query"<span class="token punctuation">:</span> "/<span class="token punctuation">*</span> select#1 <span class="token punctuation">*</span>/ select sum(`alias2`.`col_varchar_nokey`) AS `c1`,`alias2`.`pk` AS `c2` from (`t1` `alias1` straight_join `t2` `alias2` on((`alias2`.`pk` = `alias1`.`col_int_key`))) where (0 &lt;&gt; `alias1`.`pk`) group by `c2` order by `alias1`.`col_int_key`,`alias2`.`pk`"
          },
          {
            "transformations_to_nested_joins"<span class="token punctuation">:</span> {
              "transformations"<span class="token punctuation">:</span> [
                "JOIN_condition_to_WHERE",
                "parenthesis_removal"
              ] /<span class="token punctuation">*</span> transformations <span class="token punctuation">*</span>/,
              "expanded_query"<span class="token punctuation">:</span> "/<span class="token punctuation">*</span> select#1 <span class="token punctuation">*</span>/ select sum(`alias2`.`col_varchar_nokey`) AS `c1`,`alias2`.`pk` AS `c2` from `t1` `alias1` straight_join `t2` `alias2` where ((0 &lt;&gt; `alias1`.`pk`) and (`alias2`.`pk` = `alias1`.`col_int_key`)) group by `c2` order by `alias1`.`col_int_key`,`alias2`.`pk`"
            } /<span class="token punctuation">*</span> transformations_to_nested_joins <span class="token punctuation">*</span>/
          },
          {
            "functional_dependencies_of_GROUP_columns"<span class="token punctuation">:</span> {
              "all_columns_of_table_map_bits"<span class="token punctuation">:</span> [
                1
              ] /<span class="token punctuation">*</span> all_columns_of_table_map_bits <span class="token punctuation">*</span>/,
              "columns"<span class="token punctuation">:</span> [
                "test.alias2.pk",
                "test.alias1.col_int_key"
              ] /<span class="token punctuation">*</span> columns <span class="token punctuation">*</span>/
            } /<span class="token punctuation">*</span> functional_dependencies_of_GROUP_columns <span class="token punctuation">*</span>/
          }
        ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
      } /<span class="token punctuation">*</span> join_preparation <span class="token punctuation">*</span>/
    },
    {
      "join_optimization"<span class="token punctuation">:</span> {
        "select#"<span class="token punctuation">:</span> 1,
        "steps"<span class="token punctuation">:</span> [
          {
            "condition_processing"<span class="token punctuation">:</span> {
              "condition"<span class="token punctuation">:</span> "WHERE",
              "original_condition"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and (`alias2`.`pk` = `alias1`.`col_int_key`))",
              "steps"<span class="token punctuation">:</span> [
                {
                  "transformation"<span class="token punctuation">:</span> "equality_propagation",
                  "resulting_condition"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and multiple equal(`alias2`.`pk`, `alias1`.`col_int_key`))"
                },
                {
                  "transformation"<span class="token punctuation">:</span> "constant_propagation",
                  "resulting_condition"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and multiple equal(`alias2`.`pk`, `alias1`.`col_int_key`))"
                },
                {
                  "transformation"<span class="token punctuation">:</span> "trivial_condition_removal",
                  "resulting_condition"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and multiple equal(`alias2`.`pk`, `alias1`.`col_int_key`))"
                }
              ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
            } /<span class="token punctuation">*</span> condition_processing <span class="token punctuation">*</span>/
          },
          {
            "substitute_generated_columns"<span class="token punctuation">:</span> {
            } /<span class="token punctuation">*</span> substitute_generated_columns <span class="token punctuation">*</span>/
          },
          {
            "table_dependencies"<span class="token punctuation">:</span> [
              {
                "table"<span class="token punctuation">:</span> "`t1` `alias1`",
                "row_may_be_null"<span class="token punctuation">:</span> false,
                "map_bit"<span class="token punctuation">:</span> 0,
                "depends_on_map_bits"<span class="token punctuation">:</span> [
                ] /<span class="token punctuation">*</span> depends_on_map_bits <span class="token punctuation">*</span>/
              },
              {
                "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                "row_may_be_null"<span class="token punctuation">:</span> false,
                "map_bit"<span class="token punctuation">:</span> 1,
                "depends_on_map_bits"<span class="token punctuation">:</span> [
                  0
                ] /<span class="token punctuation">*</span> depends_on_map_bits <span class="token punctuation">*</span>/
              }
            ] /<span class="token punctuation">*</span> table_dependencies <span class="token punctuation">*</span>/
          },
          {
            "ref_optimizer_key_uses"<span class="token punctuation">:</span> [
              {
                "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                "field"<span class="token punctuation">:</span> "pk",
                "equals"<span class="token punctuation">:</span> "`alias1`.`col_int_key`",
                "null_rejecting"<span class="token punctuation">:</span> true
              }
            ] /<span class="token punctuation">*</span> ref_optimizer_key_uses <span class="token punctuation">*</span>/
          },
          {
            "rows_estimation"<span class="token punctuation">:</span> [
              {
                "table"<span class="token punctuation">:</span> "`t1` `alias1`",
                "table_scan"<span class="token punctuation">:</span> {
                  "rows"<span class="token punctuation">:</span> 20,
                  "cost"<span class="token punctuation">:</span> 0.25
                } /<span class="token punctuation">*</span> table_scan <span class="token punctuation">*</span>/
              },
              {
                "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                "const_keys_added"<span class="token punctuation">:</span> {
                  "keys"<span class="token punctuation">:</span> [
                    "PRIMARY"
                  ] /<span class="token punctuation">*</span> keys <span class="token punctuation">*</span>/,
                  "cause"<span class="token punctuation">:</span> "group_by"
                } /<span class="token punctuation">*</span> const_keys_added <span class="token punctuation">*</span>/,
                "range_analysis"<span class="token punctuation">:</span> {
                  "table_scan"<span class="token punctuation">:</span> {
                    "rows"<span class="token punctuation">:</span> 100,
                    "cost"<span class="token punctuation">:</span> 12.35
                  } /<span class="token punctuation">*</span> table_scan <span class="token punctuation">*</span>/,
                  "potential_range_indexes"<span class="token punctuation">:</span> [
                    {
                      "index"<span class="token punctuation">:</span> "PRIMARY",
                      "usable"<span class="token punctuation">:</span> true,
                      "key_parts"<span class="token punctuation">:</span> [
                        "pk"
                      ] /<span class="token punctuation">*</span> key_parts <span class="token punctuation">*</span>/
                    }
                  ] /<span class="token punctuation">*</span> potential_range_indexes <span class="token punctuation">*</span>/,
                  "setup_range_conditions"<span class="token punctuation">:</span> [
                  ] /<span class="token punctuation">*</span> setup_range_conditions <span class="token punctuation">*</span>/,
                  "group_index_skip_scan"<span class="token punctuation">:</span> {
                    "chosen"<span class="token punctuation">:</span> false,
                    "cause"<span class="token punctuation">:</span> "not_single_table"
                  } /<span class="token punctuation">*</span> group_index_skip_scan <span class="token punctuation">*</span>/,
                  "skip_scan_range"<span class="token punctuation">:</span> {
                    "chosen"<span class="token punctuation">:</span> false,
                    "cause"<span class="token punctuation">:</span> "not_single_table"
                  } /<span class="token punctuation">*</span> skip_scan_range <span class="token punctuation">*</span>/
                } /<span class="token punctuation">*</span> range_analysis <span class="token punctuation">*</span>/
              }
            ] /<span class="token punctuation">*</span> rows_estimation <span class="token punctuation">*</span>/
          },
          {
            "considered_execution_plans"<span class="token punctuation">:</span> [
              {
                "plan_prefix"<span class="token punctuation">:</span> [
                ] /<span class="token punctuation">*</span> plan_prefix <span class="token punctuation">*</span>/,
                "table"<span class="token punctuation">:</span> "`t1` `alias1`",
                "best_access_path"<span class="token punctuation">:</span> {
                  "considered_access_paths"<span class="token punctuation">:</span> [
                    {
                      "rows_to_scan"<span class="token punctuation">:</span> 20,
                      "filtering_effect"<span class="token punctuation">:</span> [
                      ] /<span class="token punctuation">*</span> filtering_effect <span class="token punctuation">*</span>/,
                      "final_filtering_effect"<span class="token punctuation">:</span> 0.9,
                      "access_type"<span class="token punctuation">:</span> "scan",
                      "resulting_rows"<span class="token punctuation">:</span> 18,
                      "cost"<span class="token punctuation">:</span> 2.25,
                      "chosen"<span class="token punctuation">:</span> true
                    }
                  ] /<span class="token punctuation">*</span> considered_access_paths <span class="token punctuation">*</span>/
                } /<span class="token punctuation">*</span> best_access_path <span class="token punctuation">*</span>/,
                "condition_filtering_pct"<span class="token punctuation">:</span> 100,
                "rows_for_plan"<span class="token punctuation">:</span> 18,
                "cost_for_plan"<span class="token punctuation">:</span> 2.25,
                "rest_of_plan"<span class="token punctuation">:</span> [
                  {
                    "plan_prefix"<span class="token punctuation">:</span> [
                      "`t1` `alias1`"
                    ] /<span class="token punctuation">*</span> plan_prefix <span class="token punctuation">*</span>/,
                    "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                    "best_access_path"<span class="token punctuation">:</span> {
                      "considered_access_paths"<span class="token punctuation">:</span> [
                        {
                          "access_type"<span class="token punctuation">:</span> "eq_ref",
                          "index"<span class="token punctuation">:</span> "PRIMARY",
                          "rows"<span class="token punctuation">:</span> 1,
                          "cost"<span class="token punctuation">:</span> 6.3,
                          "chosen"<span class="token punctuation">:</span> true,
                          "cause"<span class="token punctuation">:</span> "clustered_pk_chosen_by_heuristics"
                        },
                        {
                          "rows_to_scan"<span class="token punctuation">:</span> 100,
                          "filtering_effect"<span class="token punctuation">:</span> [
                          ] /<span class="token punctuation">*</span> filtering_effect <span class="token punctuation">*</span>/,
                          "final_filtering_effect"<span class="token punctuation">:</span> 1,
                          "access_type"<span class="token punctuation">:</span> "scan",
                          "using_join_cache"<span class="token punctuation">:</span> true,
                          "buffers_needed"<span class="token punctuation">:</span> 1,
                          "resulting_rows"<span class="token punctuation">:</span> 100,
                          "cost"<span class="token punctuation">:</span> 180.25,
                          "chosen"<span class="token punctuation">:</span> false
                        }
                      ] /<span class="token punctuation">*</span> considered_access_paths <span class="token punctuation">*</span>/
                    } /<span class="token punctuation">*</span> best_access_path <span class="token punctuation">*</span>/,
                    "condition_filtering_pct"<span class="token punctuation">:</span> 100,
                    "rows_for_plan"<span class="token punctuation">:</span> 18,
                    "cost_for_plan"<span class="token punctuation">:</span> 8.55,
                    "chosen"<span class="token punctuation">:</span> true
                  }
                ] /<span class="token punctuation">*</span> rest_of_plan <span class="token punctuation">*</span>/
              }
            ] /<span class="token punctuation">*</span> considered_execution_plans <span class="token punctuation">*</span>/
          },
          {
            "attaching_conditions_to_tables"<span class="token punctuation">:</span> {
              "original_condition"<span class="token punctuation">:</span> "((`alias2`.`pk` = `alias1`.`col_int_key`) and (0 &lt;&gt; `alias1`.`pk`))",
              "attached_conditions_computation"<span class="token punctuation">:</span> [
              ] /<span class="token punctuation">*</span> attached_conditions_computation <span class="token punctuation">*</span>/,
              "attached_conditions_summary"<span class="token punctuation">:</span> [
                {
                  "table"<span class="token punctuation">:</span> "`t1` `alias1`",
                  "attached"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and (`alias1`.`col_int_key` is not null))"
                },
                {
                  "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                  "attached"<span class="token punctuation">:</span> "(`alias2`.`pk` = `alias1`.`col_int_key`)"
                }
              ] /<span class="token punctuation">*</span> attached_conditions_summary <span class="token punctuation">*</span>/
            } /<span class="token punctuation">*</span> attaching_conditions_to_tables <span class="token punctuation">*</span>/
          },
          {
            "optimizing_distinct_group_by_order_by"<span class="token punctuation">:</span> {
              "simplifying_order_by"<span class="token punctuation">:</span> {
                "original_clause"<span class="token punctuation">:</span> "`alias1`.`col_int_key`,`alias2`.`pk`",
                "items"<span class="token punctuation">:</span> [
                  {
                    "item"<span class="token punctuation">:</span> "`alias1`.`col_int_key`"
                  },
                  {
                    "item"<span class="token punctuation">:</span> "`alias2`.`pk`",
                    "eq_ref_to_preceding_items"<span class="token punctuation">:</span> true
                  }
                ] /<span class="token punctuation">*</span> items <span class="token punctuation">*</span>/,
                "resulting_clause_is_simple"<span class="token punctuation">:</span> true,
                "resulting_clause"<span class="token punctuation">:</span> "`alias1`.`col_int_key`"
              } /<span class="token punctuation">*</span> simplifying_order_by <span class="token punctuation">*</span>/,
              "simplifying_group_by"<span class="token punctuation">:</span> {
                "original_clause"<span class="token punctuation">:</span> "`c2`",
                "items"<span class="token punctuation">:</span> [
                  {
                    "item"<span class="token punctuation">:</span> "`alias2`.`pk`"
                  }
                ] /<span class="token punctuation">*</span> items <span class="token punctuation">*</span>/,
                "resulting_clause_is_simple"<span class="token punctuation">:</span> false,
                "resulting_clause"<span class="token punctuation">:</span> "`c2`"
              } /<span class="token punctuation">*</span> simplifying_group_by <span class="token punctuation">*</span>/
            } /<span class="token punctuation">*</span> optimizing_distinct_group_by_order_by <span class="token punctuation">*</span>/
          },
          {
            "finalizing_table_conditions"<span class="token punctuation">:</span> [
              {
                "table"<span class="token punctuation">:</span> "`t1` `alias1`",
                "original_table_condition"<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and (`alias1`.`col_int_key` is not null))",
                "final_table_condition   "<span class="token punctuation">:</span> "((0 &lt;&gt; `alias1`.`pk`) and (`alias1`.`col_int_key` is not null))"
              },
              {
                "table"<span class="token punctuation">:</span> "`t2` `alias2`",
                "original_table_condition"<span class="token punctuation">:</span> "(`alias2`.`pk` = `alias1`.`col_int_key`)",
                "final_table_condition   "<span class="token punctuation">:</span> null
              }
            ] /<span class="token punctuation">*</span> finalizing_table_conditions <span class="token punctuation">*</span>/
          },
          {
            "refine_plan"<span class="token punctuation">:</span> [
              {
                "table"<span class="token punctuation">:</span> "`t1` `alias1`"
              },
              {
                "table"<span class="token punctuation">:</span> "`t2` `alias2`"
              }
            ] /<span class="token punctuation">*</span> refine_plan <span class="token punctuation">*</span>/
          },
          {
            "considering_tmp_tables"<span class="token punctuation">:</span> [
              {
                "adding_tmp_table_in_plan_at_position"<span class="token punctuation">:</span> 2,
                "write_method"<span class="token punctuation">:</span> "continuously_update_group_row"
              },
              {
                "adding_sort_to_table"<span class="token punctuation">:</span> ""
              } /<span class="token punctuation">*</span> filesort <span class="token punctuation">*</span>/
            ] /<span class="token punctuation">*</span> considering_tmp_tables <span class="token punctuation">*</span>/
          }
        ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
      } /<span class="token punctuation">*</span> join_optimization <span class="token punctuation">*</span>/
    },
    {
      "join_execution"<span class="token punctuation">:</span> {
        "select#"<span class="token punctuation">:</span> 1,
        "steps"<span class="token punctuation">:</span> [
          {
            "temp_table_aggregate"<span class="token punctuation">:</span> {
              "select#"<span class="token punctuation">:</span> 1,
              "steps"<span class="token punctuation">:</span> [
                {
                  "creating_tmp_table"<span class="token punctuation">:</span> {
                    "tmp_table_info"<span class="token punctuation">:</span> {
                      "table"<span class="token punctuation">:</span> "&lt;temporary&gt;",
                      "in_plan_at_position"<span class="token punctuation">:</span> 2,
                      "columns"<span class="token punctuation">:</span> 3,
                      "row_length"<span class="token punctuation">:</span> 18,
                      "key_length"<span class="token punctuation">:</span> 4,
                      "unique_constraint"<span class="token punctuation">:</span> false,
                      "makes_grouped_rows"<span class="token punctuation">:</span> true,
                      "cannot_insert_duplicates"<span class="token punctuation">:</span> false,
                      "location"<span class="token punctuation">:</span> "TempTable"
                    } /<span class="token punctuation">*</span> tmp_table_info <span class="token punctuation">*</span>/
                  } /<span class="token punctuation">*</span> creating_tmp_table <span class="token punctuation">*</span>/
                }
              ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
            } /<span class="token punctuation">*</span> temp_table_aggregate <span class="token punctuation">*</span>/
          },
          {
            "sorting_table"<span class="token punctuation">:</span> "&lt;temporary&gt;",
            "filesort_information"<span class="token punctuation">:</span> [
              {
                "direction"<span class="token punctuation">:</span> "asc",
                "expression"<span class="token punctuation">:</span> "`alias1`.`col_int_key`"
              }
            ] /<span class="token punctuation">*</span> filesort_information <span class="token punctuation">*</span>/,
            "filesort_priority_queue_optimization"<span class="token punctuation">:</span> {
              "usable"<span class="token punctuation">:</span> false,
              "cause"<span class="token punctuation">:</span> "not applicable (no LIMIT)"
            } /<span class="token punctuation">*</span> filesort_priority_queue_optimization <span class="token punctuation">*</span>/,
            "filesort_execution"<span class="token punctuation">:</span> [
            ] /<span class="token punctuation">*</span> filesort_execution <span class="token punctuation">*</span>/,
            "filesort_summary"<span class="token punctuation">:</span> {
              "memory_available"<span class="token punctuation">:</span> 262144,
              "key_size"<span class="token punctuation">:</span> 9,
              "row_size"<span class="token punctuation">:</span> 26,
              "max_rows_per_buffer"<span class="token punctuation">:</span> 7710,
              "num_rows_estimate"<span class="token punctuation">:</span> 18446744073709551615,
              "num_rows_found"<span class="token punctuation">:</span> 8,
              "num_initial_chunks_spilled_to_disk"<span class="token punctuation">:</span> 0,
              "peak_memory_used"<span class="token punctuation">:</span> 32832,
              "sort_algorithm"<span class="token punctuation">:</span> "std<span class="token punctuation">:</span><span class="token punctuation">:</span>sort",
              "unpacked_addon_fields"<span class="token punctuation">:</span> "skip_heuristic",
              "sort_mode"<span class="token punctuation">:</span> "&lt;fixed_sort_key, additional_fields&gt;"
            } /<span class="token punctuation">*</span> filesort_summary <span class="token punctuation">*</span>/
          }
        ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
      } /<span class="token punctuation">*</span> join_execution <span class="token punctuation">*</span>/
    }
  ] /<span class="token punctuation">*</span> steps <span class="token punctuation">*</span>/
}
MISSING_BYTES_BEYOND_MAX_MEM_SIZE<span class="token punctuation">:</span> 0
          INSUFFICIENT_PRIVILEGES<span class="token punctuation">:</span> 0</span></code></pre>
  </div>
 </div>
 <br/>
</div>
