<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-innodb-cached-indexes-table">
      </a>
      28.4.5 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045077331680">
  </a>
  <p>
   The
   <a class="link" href="information-schema-innodb-cached-indexes-table.html" title="28.4.5 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table">
    <code class="literal">
     INNODB_CACHED_INDEXES
    </code>
   </a>
   table
      reports the number of index pages cached in the
   <code class="literal">
    InnoDB
   </code>
   buffer pool for each index.
  </p>
  <p>
   For related usage information and examples, see
   <a class="xref" href="innodb-information-schema-buffer-pool-tables.html" title="17.15.5 InnoDB INFORMATION_SCHEMA Buffer Pool Tables">
    Section 17.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="information-schema-innodb-cached-indexes-table.html" title="28.4.5 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table">
    <code class="literal">
     INNODB_CACHED_INDEXES
    </code>
   </a>
   table has
      these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       SPACE_ID
      </code>
     </p>
     <p>
      The tablespace ID.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       INDEX_ID
      </code>
     </p>
     <p>
      An identifier for the index. Index identifiers are unique
          across all the databases in an instance.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       N_CACHED_PAGES
      </code>
     </p>
     <p>
      The total number of index pages cached in the
      <code class="literal">
       InnoDB
      </code>
      buffer pool for a specific index
          since MySQL Server last started.
     </p>
    </li>
   </ul>
  </div>
  <h4>
   <a name="idm46045077317728">
   </a>
   Examples
  </h4>
  <p>
   This query returns the number of index pages cached in the
   <code class="literal">
    InnoDB
   </code>
   buffer pool for a specific index:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68442684"><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>INNODB_CACHED_INDEXES <span class="token keyword">WHERE</span> INDEX_ID<span class="token operator">=</span><span class="token number">65</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>
      SPACE_ID<span class="token punctuation">:</span> 4294967294
      INDEX_ID<span class="token punctuation">:</span> 65
N_CACHED_PAGES<span class="token punctuation">:</span> 45</span></code></pre>
  </div>
  <p>
   This query returns the number of index pages cached in the
   <code class="literal">
    InnoDB
   </code>
   buffer pool for each index, using the
   <a class="link" href="information-schema-innodb-indexes-table.html" title="28.4.20 The INFORMATION_SCHEMA INNODB_INDEXES Table">
    <code class="literal">
     INNODB_INDEXES
    </code>
   </a>
   and
   <a class="link" href="information-schema-innodb-tables-table.html" title="28.4.23 The INFORMATION_SCHEMA INNODB_TABLES Table">
    <code class="literal">
     INNODB_TABLES
    </code>
   </a>
   tables to resolve the
      table name and index name for each
   <code class="literal">
    INDEX_ID
   </code>
   value.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa6187851"><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 keyword">tables</span><span class="token punctuation">.</span><span class="token keyword">NAME</span> <span class="token keyword">AS</span> <span class="token keyword">table_name</span><span class="token punctuation">,</span>
  <span class="token keyword">indexes</span><span class="token punctuation">.</span><span class="token keyword">NAME</span> <span class="token keyword">AS</span> index_name<span class="token punctuation">,</span>
  cached<span class="token punctuation">.</span>N_CACHED_PAGES <span class="token keyword">AS</span> n_cached_pages
<span class="token keyword">FROM</span>
  INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_CACHED_INDEXES <span class="token keyword">AS</span> cached<span class="token punctuation">,</span>
  INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_INDEXES <span class="token keyword">AS</span> <span class="token keyword">indexes</span><span class="token punctuation">,</span>
  INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_TABLES <span class="token keyword">AS</span> <span class="token keyword">tables</span>
<span class="token keyword">WHERE</span>
  cached<span class="token punctuation">.</span>INDEX_ID <span class="token operator">=</span> <span class="token keyword">indexes</span><span class="token punctuation">.</span>INDEX_ID
  <span class="token operator">AND</span> <span class="token keyword">indexes</span><span class="token punctuation">.</span>TABLE_ID <span class="token operator">=</span> <span class="token keyword">tables</span><span class="token punctuation">.</span>TABLE_ID<span class="token punctuation">;</span></code></pre>
  </div>
  <h4>
   <a name="idm46045077308224">
   </a>
   Notes
  </h4>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      You must have the
      <a class="link" href="privileges-provided.html#priv_process">
       <code class="literal">
        PROCESS
       </code>
      </a>
      privilege to query this table.
     </p>
    </li>
    <li class="listitem">
     <p>
      Use the
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      <a class="link" href="information-schema-columns-table.html" title="28.3.8 The INFORMATION_SCHEMA COLUMNS Table">
       <code class="literal">
        COLUMNS
       </code>
      </a>
      table or the
      <a class="link" href="show-columns.html" title="15.7.7.6 SHOW COLUMNS Statement">
       <code class="literal">
        SHOW COLUMNS
       </code>
      </a>
      statement to view
          additional information about the columns of this table,
          including data types and default values.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
