<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="index-extensions">
      </a>
      10.3.10 Use of Index Extensions
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045227152256">
  </a>
  <p>
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   automatically extends each
        secondary index by appending the primary key columns to it.
        Consider this table definition:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa57790035"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
  i1 <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">DEFAULT</span> <span class="token number">0</span><span class="token punctuation">,</span>
  i2 <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">DEFAULT</span> <span class="token number">0</span><span class="token punctuation">,</span>
  d <span class="token datatype">DATE</span> <span class="token keyword">DEFAULT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
  <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>i1<span class="token punctuation">,</span> i2<span class="token punctuation">)</span><span class="token punctuation">,</span>
  <span class="token keyword">INDEX</span> k_d <span class="token punctuation">(</span>d<span class="token punctuation">)</span>
<span class="token punctuation">)</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> InnoDB<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   This table defines the primary key on columns
   <code class="literal">
    (i1,
        i2)
   </code>
   . It also defines a secondary index
   <code class="literal">
    k_d
   </code>
   on column
   <code class="literal">
    (d)
   </code>
   , but
        internally
   <code class="literal">
    InnoDB
   </code>
   extends this index and
        treats it as columns
   <code class="literal">
    (d, i1, i2)
   </code>
   .
  </p>
  <p>
   The optimizer takes into account the primary key columns of the
        extended secondary index when determining how and whether to use
        that index. This can result in more efficient query execution
        plans and better performance.
  </p>
  <p>
   The optimizer can use extended secondary indexes for
   <code class="literal">
    ref
   </code>
   ,
   <code class="literal">
    range
   </code>
   , and
   <a class="link" href="switchable-optimizations.html#optflag_index-merge">
    <code class="literal">
     index_merge
    </code>
   </a>
   index access, for
        Loose Index Scan access, for join and sorting optimization, and
        for
   <a class="link" href="aggregate-functions.html#function_min">
    <code class="literal">
     MIN()
    </code>
   </a>
   /
   <a class="link" href="aggregate-functions.html#function_max">
    <code class="literal">
     MAX()
    </code>
   </a>
   optimization.
  </p>
  <p>
   The following example shows how execution plans are affected by
        whether the optimizer uses extended secondary indexes. Suppose
        that
   <code class="literal">
    t1
   </code>
   is populated with these rows:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa74740673"><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">INSERT</span> <span class="token keyword">INTO</span> t1 <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">1</span><span class="token punctuation">,</span> <span class="token string">'1998-01-01'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token string">'1999-01-01'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token string">'2000-01-01'</span><span class="token punctuation">)</span><span class="token punctuation">,</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">'2001-01-01'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token string">'2002-01-01'</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">1</span><span class="token punctuation">,</span> <span class="token string">'1998-01-01'</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">2</span><span class="token punctuation">,</span> <span class="token string">'1999-01-01'</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">3</span><span class="token punctuation">,</span> <span class="token string">'2000-01-01'</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">4</span><span class="token punctuation">,</span> <span class="token string">'2001-01-01'</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">5</span><span class="token punctuation">,</span> <span class="token string">'2002-01-01'</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">1</span><span class="token punctuation">,</span> <span class="token string">'1998-01-01'</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">2</span><span class="token punctuation">,</span> <span class="token string">'1999-01-01'</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">3</span><span class="token punctuation">,</span> <span class="token string">'2000-01-01'</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">4</span><span class="token punctuation">,</span> <span class="token string">'2001-01-01'</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">5</span><span class="token punctuation">,</span> <span class="token string">'2002-01-01'</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">1</span><span class="token punctuation">,</span> <span class="token string">'1998-01-01'</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">2</span><span class="token punctuation">,</span> <span class="token string">'1999-01-01'</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">3</span><span class="token punctuation">,</span> <span class="token string">'2000-01-01'</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">4</span><span class="token punctuation">,</span> <span class="token string">'2001-01-01'</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">5</span><span class="token punctuation">,</span> <span class="token string">'2002-01-01'</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">1</span><span class="token punctuation">,</span> <span class="token string">'1998-01-01'</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">2</span><span class="token punctuation">,</span> <span class="token string">'1999-01-01'</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">3</span><span class="token punctuation">,</span> <span class="token string">'2000-01-01'</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">4</span><span class="token punctuation">,</span> <span class="token string">'2001-01-01'</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">5</span><span class="token punctuation">,</span> <span class="token string">'2002-01-01'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Now consider this query:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa58743772"><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">EXPLAIN</span> <span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> i1 <span class="token operator">=</span> <span class="token number">3</span> <span class="token operator">AND</span> d <span class="token operator">=</span> <span class="token string">'2000-01-01'</span></code></pre>
  </div>
  <p>
   The execution plan depends on whether the extended index is
        used.
  </p>
  <p>
   When the optimizer does not consider index extensions, it treats
        the index
   <code class="literal">
    k_d
   </code>
   as only
   <code class="literal">
    (d)
   </code>
   .
   <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
    <code class="literal">
     EXPLAIN
    </code>
   </a>
   for the query produces
        this result:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa58512387"><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">EXPLAIN</span> <span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> i1 <span class="token operator">=</span> <span class="token number">3</span> <span class="token operator">AND</span> d <span class="token operator">=</span> <span class="token string">'2000-01-01'</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
           id<span class="token punctuation">:</span> 1
  select_type<span class="token punctuation">:</span> SIMPLE
        table<span class="token punctuation">:</span> t1
         type<span class="token punctuation">:</span> ref
possible_keys<span class="token punctuation">:</span> PRIMARY,k_d
          key<span class="token punctuation">:</span> k_d
      key_len<span class="token punctuation">:</span> 4
          ref<span class="token punctuation">:</span> const
         rows<span class="token punctuation">:</span> 5
        Extra<span class="token punctuation">:</span> Using where; Using index</span></code></pre>
  </div>
  <p>
   When the optimizer takes index extensions into account, it
        treats
   <code class="literal">
    k_d
   </code>
   as
   <code class="literal">
    (d, i1, i2)
   </code>
   .
        In this case, it can use the leftmost index prefix
   <code class="literal">
    (d,
        i1)
   </code>
   to produce a better execution plan:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa14073553"><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">EXPLAIN</span> <span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> i1 <span class="token operator">=</span> <span class="token number">3</span> <span class="token operator">AND</span> d <span class="token operator">=</span> <span class="token string">'2000-01-01'</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
           id<span class="token punctuation">:</span> 1
  select_type<span class="token punctuation">:</span> SIMPLE
        table<span class="token punctuation">:</span> t1
         type<span class="token punctuation">:</span> ref
possible_keys<span class="token punctuation">:</span> PRIMARY,k_d
          key<span class="token punctuation">:</span> k_d
      key_len<span class="token punctuation">:</span> 8
          ref<span class="token punctuation">:</span> const,const
         rows<span class="token punctuation">:</span> 1
        Extra<span class="token punctuation">:</span> Using index</span></code></pre>
  </div>
  <p>
   In both cases,
   <code class="literal">
    key
   </code>
   indicates that the
        optimizer uses secondary index
   <code class="literal">
    k_d
   </code>
   but the
   <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
    <code class="literal">
     EXPLAIN
    </code>
   </a>
   output shows these
        improvements from using the extended index:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       key_len
      </code>
      goes from 4 bytes to 8 bytes,
            indicating that key lookups use columns
      <code class="literal">
       d
      </code>
      and
      <code class="literal">
       i1
      </code>
      , not just
      <code class="literal">
       d
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <code class="literal">
       ref
      </code>
      value changes from
      <code class="literal">
       const
      </code>
      to
      <code class="literal">
       const,const
      </code>
      because the key lookup uses two key parts, not one.
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <code class="literal">
       rows
      </code>
      count decreases from 5 to 1,
            indicating that
      <code class="literal">
       InnoDB
      </code>
      should need to
            examine fewer rows to produce the result.
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <code class="literal">
       Extra
      </code>
      value changes from
      <code class="literal">
       Using where; Using index
      </code>
      to
      <code class="literal">
       Using index
      </code>
      . This means that rows can be
            read using only the index, without consulting columns in the
            data row.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Differences in optimizer behavior for use of extended indexes
        can also be seen with
   <a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
    <code class="literal">
     SHOW
        STATUS
    </code>
   </a>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa9403213"><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">FLUSH</span> <span class="token keyword">TABLE</span> t1<span class="token punctuation">;</span>
<span class="token keyword">FLUSH</span> <span class="token keyword">STATUS</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> i1 <span class="token operator">=</span> <span class="token number">3</span> <span class="token operator">AND</span> d <span class="token operator">=</span> <span class="token string">'2000-01-01'</span><span class="token punctuation">;</span>
<span class="token keyword">SHOW</span> <span class="token keyword">STATUS</span> <span class="token operator">LIKE</span> <span class="token string">'handler_read%'</span></code></pre>
  </div>
  <p>
   The preceding statements include
   <a class="link" href="flush.html#flush-tables">
    <code class="literal">
     FLUSH
        TABLES
    </code>
   </a>
   and
   <a class="link" href="flush.html#flush-status">
    <code class="literal">
     FLUSH STATUS
    </code>
   </a>
   to flush the table cache and clear the status counters.
  </p>
  <p>
   Without index extensions,
   <a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
    <code class="literal">
     SHOW
        STATUS
    </code>
   </a>
   produces this result:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa95402358"><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-none">+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| Handler_read_first    | 0     |
| Handler_read_key      | 1     |
| Handler_read_last     | 0     |
| Handler_read_next     | 5     |
| Handler_read_prev     | 0     |
| Handler_read_rnd      | 0     |
| Handler_read_rnd_next | 0     |
+-----------------------+-------+</code></pre>
  </div>
  <p>
   With index extensions,
   <a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
    <code class="literal">
     SHOW
        STATUS
    </code>
   </a>
   produces this result. The
   <a class="link" href="server-status-variables.html#statvar_Handler_read_next">
    <code class="literal">
     Handler_read_next
    </code>
   </a>
   value
        decreases from 5 to 1, indicating more efficient use of the
        index:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa96212043"><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-none">+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| Handler_read_first    | 0     |
| Handler_read_key      | 1     |
| Handler_read_last     | 0     |
| Handler_read_next     | 1     |
| Handler_read_prev     | 0     |
| Handler_read_rnd      | 0     |
| Handler_read_rnd_next | 0     |
+-----------------------+-------+</code></pre>
  </div>
  <p>
   The
   <a class="link" href="switchable-optimizations.html#optflag_use-index-extensions">
    <code class="literal">
     use_index_extensions
    </code>
   </a>
   flag
        of the
   <a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
    <code class="literal">
     optimizer_switch
    </code>
   </a>
   system
        variable permits control over whether the optimizer takes the
        primary key columns into account when determining how to use an
   <code class="literal">
    InnoDB
   </code>
   table's secondary indexes. By
        default,
   <a class="link" href="switchable-optimizations.html#optflag_use-index-extensions">
    <code class="literal">
     use_index_extensions
    </code>
   </a>
   is enabled. To check whether disabling use of index extensions
        can improve performance, use this statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28835181"><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">SET</span> optimizer_switch <span class="token operator">=</span> <span class="token string">'use_index_extensions=off'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Use of index extensions by the optimizer is subject to the usual
        limits on the number of key parts in an index (16) and the
        maximum key length (3072 bytes).
  </p>
 </div>
 <br/>
</div>
