<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-files-table">
      </a>
      28.3.15 The INFORMATION_SCHEMA FILES Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045079850704">
  </a>
  <a class="indexterm" name="idm46045079849200">
  </a>
  <p>
   The
   <code class="literal">
    FILES
   </code>
   table provides information about the
      files in which MySQL tablespace data is stored.
  </p>
  <p>
   The
   <code class="literal">
    FILES
   </code>
   table provides information about
   <code class="literal">
    InnoDB
   </code>
   data files. In NDB Cluster, this table
      also provides information about the files in which NDB Cluster
      Disk Data tables are stored. For additional information specific
      to
   <code class="literal">
    InnoDB
   </code>
   , see
   <a class="xref" href="information-schema-files-table.html#files-table-innodb-notes" title="InnoDB Notes">
    InnoDB Notes
   </a>
   , later in this section;
      for additional information specific to NDB Cluster, see
   <a class="xref" href="information-schema-files-table.html#files-table-ndb-notes" title="NDB Notes">
    NDB Notes
   </a>
   .
  </p>
  <p>
   The
   <code class="literal">
    FILES
   </code>
   table has these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       FILE_ID
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The tablespace ID, also
          referred to as the
      <code class="literal">
       space_id
      </code>
      or
      <code class="literal">
       fil_space_t::id
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : A file identifier.
      <code class="literal">
       FILE_ID
      </code>
      column values are auto-generated.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FILE_NAME
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The name of the data file.
          File-per-table and general tablespaces have an
      <code class="filename">
       .ibd
      </code>
      file name extension. Undo
          tablespaces are prefixed by
      <code class="literal">
       undo
      </code>
      . The
          system tablespace is prefixed by
      <code class="literal">
       ibdata
      </code>
      .
          The global temporary tablespace is prefixed by
      <code class="literal">
       ibtmp
      </code>
      . The file name includes the file
          path, which may be relative to the MySQL data directory (the
          value of the
      <a class="link" href="server-system-variables.html#sysvar_datadir">
       <code class="literal">
        datadir
       </code>
      </a>
      system
          variable).
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The name of an undo log file
          created by
      <a class="link" href="create-logfile-group.html" title="15.1.16 CREATE LOGFILE GROUP Statement">
       <code class="literal">
        CREATE LOGFILE GROUP
       </code>
      </a>
      or
      <a class="link" href="alter-logfile-group.html" title="15.1.6 ALTER LOGFILE GROUP Statement">
       <code class="literal">
        ALTER LOGFILE GROUP
       </code>
      </a>
      , or of a
          data file created by
      <a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
       <code class="literal">
        CREATE
          TABLESPACE
       </code>
      </a>
      or
      <a class="link" href="alter-tablespace.html" title="15.1.10 ALTER TABLESPACE Statement">
       <code class="literal">
        ALTER
          TABLESPACE
       </code>
      </a>
      . In NDB 8.4, the file name
          is shown with a relative path; for an undo log file, this path
          is relative to the directory
      <code class="filename">
       <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datadir">
        <code class="literal">
         DataDir
        </code>
       </a>
       /ndb_
       <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-nodeid">
        <code class="literal">
         NodeId
        </code>
       </a>
       _fs/LG
      </code>
      ;
          for a data file, it is relative to the directory
      <code class="filename">
       <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datadir">
        <code class="literal">
         DataDir
        </code>
       </a>
       /ndb_
       <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-nodeid">
        <code class="literal">
         NodeId
        </code>
       </a>
       _fs/TS
      </code>
      .
          This means, for example, that the name of a data file created
          with
      <code class="literal">
       ALTER TABLESPACE ts ADD DATAFILE 'data_2.dat'
          INITIAL SIZE 256M
      </code>
      is shown as
      <code class="literal">
       ./data_2.dat
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FILE_TYPE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The tablespace file type. There
          are three possible file types for
      <code class="literal">
       InnoDB
      </code>
      files.
      <code class="literal">
       TABLESPACE
      </code>
      is the file type for any
          system, general, or file-per-table tablespace file that holds
          tables, indexes, or other forms of user data.
      <code class="literal">
       TEMPORARY
      </code>
      is the file type for temporary
          tablespaces.
      <code class="literal">
       UNDO LOG
      </code>
      is the file type for
          undo tablespaces, which hold undo records.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : One of the values
      <code class="literal">
       UNDO
          LOG
      </code>
      or
      <code class="literal">
       DATAFILE
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TABLESPACE_NAME
      </code>
     </p>
     <p>
      The name of the tablespace with which the file is associated.
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : General tablespace names are as
          specified when created. File-per-table tablespace names are
          shown in the following format:
      <code class="literal">
       <em class="replaceable">
        <code>
         schema_name
        </code>
       </em>
       /
       <em class="replaceable">
        <code>
         table_name
        </code>
       </em>
      </code>
      .
          The
      <code class="literal">
       InnoDB
      </code>
      system tablespace name is
      <code class="literal">
       innodb_system
      </code>
      . The global temporary
          tablespace name is
      <code class="literal">
       innodb_temporary
      </code>
      .
          Default undo tablespace names are
      <code class="literal">
       innodb_undo_001
      </code>
      and
      <code class="literal">
       innodb_undo_002
      </code>
      . User-created undo
          tablespace names are as specified when created.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TABLE_CATALOG
      </code>
     </p>
     <p>
      This value is always empty.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TABLE_SCHEMA
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TABLE_NAME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LOGFILE_GROUP_NAME
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The name of the log file group to
          which the log file or data file belongs.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LOGFILE_GROUP_NUMBER
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : For a Disk Data undo log file, the
          auto-generated ID number of the log file group to which the
          log file belongs. This is the same as the value shown for the
      <code class="literal">
       id
      </code>
      column in the
      <a class="link" href="mysql-cluster-ndbinfo-dict-obj-info.html" title="25.6.17.25 The ndbinfo dict_obj_info Table">
       <code class="literal">
        ndbinfo.dict_obj_info
       </code>
      </a>
      table
          and the
      <code class="literal">
       log_id
      </code>
      column in the
      <a class="link" href="mysql-cluster-ndbinfo-logspaces.html" title="25.6.17.44 The ndbinfo logspaces Table">
       <code class="literal">
        ndbinfo.logspaces
       </code>
      </a>
      and
      <a class="link" href="mysql-cluster-ndbinfo-logspaces.html" title="25.6.17.44 The ndbinfo logspaces Table">
       <code class="literal">
        ndbinfo.logspaces
       </code>
      </a>
      tables for
          this undo log file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ENGINE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This value is always
      <code class="literal">
       InnoDB
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : This value is always
      <code class="literal">
       ndbcluster
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FULLTEXT_KEYS
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DELETED_ROWS
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UPDATE_COUNT
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FREE_EXTENTS
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The number of fully free
          extents in the current data file.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The number of extents which have
          not yet been used by the file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TOTAL_EXTENTS
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The number of full extents used
          in the current data file. Any partial extent at the end of the
          file is not counted.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The total number of extents
          allocated to the file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       EXTENT_SIZE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : Extent size is 1048576 (1MB)
          for files with a 4KB, 8KB, or 16KB page size. Extent size is
          2097152 bytes (2MB) for files with a 32KB page size, and
          4194304 (4MB) for files with a 64KB page size.
      <a class="link" href="information-schema-files-table.html" title="28.3.15 The INFORMATION_SCHEMA FILES Table">
       <code class="literal">
        FILES
       </code>
      </a>
      does not report
      <code class="literal">
       InnoDB
      </code>
      page size. Page size is defined by
          the
      <a class="link" href="innodb-parameters.html#sysvar_innodb_page_size">
       <code class="literal">
        innodb_page_size
       </code>
      </a>
      system
          variable. Extent size information can also be retrieved from
          the
      <a class="link" href="information-schema-innodb-tablespaces-table.html" title="28.4.24 The INFORMATION_SCHEMA INNODB_TABLESPACES Table">
       <code class="literal">
        INNODB_TABLESPACES
       </code>
      </a>
      table
          where
      <code class="literal">
       FILES.FILE_ID =
          INNODB_TABLESPACES.SPACE
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The size of an extent for the file
          in bytes.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       INITIAL_SIZE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The initial size of the file in
          bytes.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The size of the file in bytes.
          This is the same value that was used in the
      <code class="literal">
       INITIAL_SIZE
      </code>
      clause of the
      <a class="link" href="create-logfile-group.html" title="15.1.16 CREATE LOGFILE GROUP Statement">
       <code class="literal">
        CREATE LOGFILE GROUP
       </code>
      </a>
      ,
      <a class="link" href="alter-logfile-group.html" title="15.1.6 ALTER LOGFILE GROUP Statement">
       <code class="literal">
        ALTER LOGFILE GROUP
       </code>
      </a>
      ,
      <a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
       <code class="literal">
        CREATE TABLESPACE
       </code>
      </a>
      , or
      <a class="link" href="alter-tablespace.html" title="15.1.10 ALTER TABLESPACE Statement">
       <code class="literal">
        ALTER TABLESPACE
       </code>
      </a>
      statement used
          to create the file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MAXIMUM_SIZE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The maximum number of bytes
          permitted in the file. The value is
      <code class="literal">
       NULL
      </code>
      for all data files except for predefined system tablespace
          data files. Maximum system tablespace file size is defined by
      <a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
       <code class="literal">
        innodb_data_file_path
       </code>
      </a>
      .
          Maximum global temporary tablespace file size is defined by
      <a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
       <code class="literal">
        innodb_temp_data_file_path
       </code>
      </a>
      . A
      <code class="literal">
       NULL
      </code>
      value for a predefined system
          tablespace data file indicates that a file size limit was not
          defined explicitly.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : This value is always the same as
          the
      <code class="literal">
       INITIAL_SIZE
      </code>
      value.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       AUTOEXTEND_SIZE
      </code>
     </p>
     <p>
      The auto-extend size of the tablespace. For
      <code class="literal">
       NDB
      </code>
      ,
      <code class="literal">
       AUTOEXTEND_SIZE
      </code>
      is
          always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CREATION_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_UPDATE_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       LAST_ACCESS_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       RECOVER_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TRANSACTION_COUNTER
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       VERSION
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : The version number of the file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ROW_FORMAT
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : One of
      <code class="literal">
       FIXED
      </code>
      or
      <code class="literal">
       DYNAMIC
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TABLE_ROWS
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       AVG_ROW_LENGTH
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DATA_LENGTH
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MAX_DATA_LENGTH
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       INDEX_LENGTH
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DATA_FREE
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : The total amount of free space
          (in bytes) for the entire tablespace. Predefined system
          tablespaces, which include the system tablespace and temporary
          table tablespaces, may have one or more data files.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CREATE_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UPDATE_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CHECK_TIME
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       CHECKSUM
      </code>
     </p>
     <p>
      This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STATUS
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This value is
      <code class="literal">
       NORMAL
      </code>
      by default.
      <code class="literal">
       InnoDB
      </code>
      file-per-table tablespaces may
          report
      <code class="literal">
       IMPORTING
      </code>
      , which indicates that the
          tablespace is not yet available.
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : For NDB Cluster Disk Data files,
          this value is always
      <code class="literal">
       NORMAL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       EXTRA
      </code>
     </p>
     <p>
      For
      <code class="literal">
       InnoDB
      </code>
      : This is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For
      <code class="literal">
       NDB
      </code>
      : For undo log files, this column
          shows the undo log buffer size; for data files, it is always
      <span class="emphasis">
       <em>
        NULL
       </em>
      </span>
      . A more detailed explanation is
          provided in the next few paragraphs.
     </p>
     <p>
      <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
       <code class="literal">
        NDB
       </code>
      </a>
      stores a copy of each data
          file and each undo log file on each data node in the cluster.
          The
      <code class="literal">
       FILES
      </code>
      table contains one row for each
          such file. Suppose that you run the following two statements
          on an NDB Cluster with four data nodes:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa59001128"><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">LOGFILE</span> <span class="token keyword">GROUP</span> mygroup
    <span class="token keyword">ADD</span> <span class="token keyword">UNDOFILE</span> <span class="token string">'new_undo.dat'</span>
    <span class="token keyword">INITIAL_SIZE</span> 2G
    <span class="token keyword">ENGINE</span> <span class="token keyword">NDBCLUSTER</span><span class="token punctuation">;</span>

<span class="token keyword">CREATE</span> <span class="token keyword">TABLESPACE</span> myts
    <span class="token keyword">ADD</span> <span class="token keyword">DATAFILE</span> <span class="token string">'data_1.dat'</span>
    <span class="token keyword">USE</span> <span class="token keyword">LOGFILE</span> <span class="token keyword">GROUP</span> mygroup
    <span class="token keyword">INITIAL_SIZE</span> 256M
    <span class="token keyword">ENGINE</span> <span class="token keyword">NDBCLUSTER</span><span class="token punctuation">;</span></code></pre>
     </div>
     <p>
      After running these two statements successfully, you should
          see a result similar to the one shown here for this query
          against the
      <a class="link" href="information-schema-files-table.html" title="28.3.15 The INFORMATION_SCHEMA FILES Table">
       <code class="literal">
        FILES
       </code>
      </a>
      table:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa49308716"><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> LOGFILE_GROUP_NAME<span class="token punctuation">,</span> FILE_TYPE<span class="token punctuation">,</span> EXTRA
<span class="token prompt">    -&gt;</span>     <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES
<span class="token prompt">    -&gt;</span>     <span class="token keyword">WHERE</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> <span class="token string">'ndbcluster'</span><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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="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> LOGFILE_GROUP_NAME <span class="token punctuation">|</span> FILE_TYPE <span class="token punctuation">|</span> EXTRA                    <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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="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> mygroup            <span class="token punctuation">|</span> UNDO LOG  <span class="token punctuation">|</span> UNDO_BUFFER_SIZE=8388608 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mygroup            <span class="token punctuation">|</span> DATAFILE  <span class="token punctuation">|</span> NULL                     <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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="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>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="files-table-notes">
       </a>
       Notes
      </h4>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a class="link" href="information-schema-files-table.html" title="28.3.15 The INFORMATION_SCHEMA FILES Table">
        <code class="literal">
         FILES
        </code>
       </a>
       is a nonstandard
       <code class="literal">
        INFORMATION_SCHEMA
       </code>
       table.
      </p>
     </li>
     <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>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="files-table-innodb-notes">
       </a>
       InnoDB Notes
      </h4>
     </div>
    </div>
   </div>
   <p>
    The following notes apply to
    <code class="literal">
     InnoDB
    </code>
    data
        files.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Information reported by
       <code class="literal">
        FILES
       </code>
       is obtained
            from the
       <code class="literal">
        InnoDB
       </code>
       in-memory cache for open
            files, whereas
       <a class="link" href="information-schema-innodb-datafiles-table.html" title="28.4.10 The INFORMATION_SCHEMA INNODB_DATAFILES Table">
        <code class="literal">
         INNODB_DATAFILES
        </code>
       </a>
       gets its data from the
       <code class="literal">
        InnoDB
       </code>
       <code class="literal">
        SYS_DATAFILES
       </code>
       internal data dictionary
            table.
      </p>
     </li>
     <li class="listitem">
      <p>
       The information provided by
       <code class="literal">
        FILES
       </code>
       includes global temporary tablespace information which is
            not available in the
       <code class="literal">
        InnoDB
       </code>
       <code class="literal">
        SYS_DATAFILES
       </code>
       internal data dictionary
            table, and is therefore not included in
       <a class="link" href="information-schema-innodb-datafiles-table.html" title="28.4.10 The INFORMATION_SCHEMA INNODB_DATAFILES Table">
        <code class="literal">
         INNODB_DATAFILES
        </code>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Undo tablespace information is shown in
       <code class="literal">
        FILES
       </code>
       when separate undo tablespaces are
            present, as they are by default in MySQL 8.4.
      </p>
     </li>
     <li class="listitem">
      <p>
       The following query returns all
       <code class="literal">
        FILES
       </code>
       table information relating to
       <code class="literal">
        InnoDB
       </code>
       tablespaces.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa41197914"><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>
  FILE_ID<span class="token punctuation">,</span> FILE_NAME<span class="token punctuation">,</span> FILE_TYPE<span class="token punctuation">,</span> TABLESPACE_NAME<span class="token punctuation">,</span> FREE_EXTENTS<span class="token punctuation">,</span>
  TOTAL_EXTENTS<span class="token punctuation">,</span> <span class="token keyword">EXTENT_SIZE</span><span class="token punctuation">,</span> <span class="token keyword">INITIAL_SIZE</span><span class="token punctuation">,</span> MAXIMUM_SIZE<span class="token punctuation">,</span>
  <span class="token keyword">AUTOEXTEND_SIZE</span><span class="token punctuation">,</span> DATA_FREE<span class="token punctuation">,</span> <span class="token keyword">STATUS</span>
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES
<span class="token keyword">WHERE</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span><span class="token string">'InnoDB'</span>\G</code></pre>
      </div>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="files-table-ndb-notes">
       </a>
       NDB Notes
      </h4>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       The
       <code class="literal">
        FILES
       </code>
       table provides information
            about Disk Data
       <span class="emphasis">
        <em>
         files
        </em>
       </span>
       only; you cannot
            use it for determining disk space allocation or availability
            for individual
       <code class="literal">
        NDB
       </code>
       tables. However, it is
            possible to see how much space is allocated for each
       <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
        <code class="literal">
         NDB
        </code>
       </a>
       table having data stored on
            disk—as well as how much remains available for storage
            of data on disk for that table—using
       <a class="link" href="mysql-cluster-programs-ndb-desc.html" title="25.5.9 ndb_desc — Describe NDB Tables">
        <span class="command">
         <strong>
          ndb_desc
         </strong>
        </span>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Much of the information contained in the
       <code class="literal">
        FILES
       </code>
       table can also be found in the
       <code class="literal">
        ndbinfo
       </code>
       <a class="link" href="mysql-cluster-ndbinfo-files.html" title="25.6.17.36 The ndbinfo files Table">
        <code class="literal">
         files
        </code>
       </a>
       table.
      </p>
     </li>
     <li class="listitem">
      <p>
       The
       <code class="literal">
        CREATION_TIME
       </code>
       ,
       <code class="literal">
        LAST_UPDATE_TIME
       </code>
       , and
       <code class="literal">
        LAST_ACCESSED
       </code>
       values are as reported by
            the operating system, and are not supplied by the
       <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
        <code class="literal">
         NDB
        </code>
       </a>
       storage engine. Where no
            value is provided by the operating system, these columns
            display
       <code class="literal">
        NULL
       </code>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       The difference between the
       <code class="literal">
        TOTAL EXTENTS
       </code>
       and
       <code class="literal">
        FREE_EXTENTS
       </code>
       columns is the number of
            extents currently in use by the file:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa70174357"><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> TOTAL_EXTENTS <span class="token operator">-</span> FREE_EXTENTS <span class="token keyword">AS</span> extents_used
    <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES
    <span class="token keyword">WHERE</span> FILE_NAME <span class="token operator">=</span> <span class="token string">'./myfile.dat'</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       To approximate the amount of disk space in use by the file,
            multiply that difference by the value of the
       <code class="literal">
        EXTENT_SIZE
       </code>
       column, which gives the size
            of an extent for the file in bytes:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80249705"><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 punctuation">(</span>TOTAL_EXTENTS <span class="token operator">-</span> FREE_EXTENTS<span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token keyword">EXTENT_SIZE</span> <span class="token keyword">AS</span> bytes_used
    <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES
    <span class="token keyword">WHERE</span> FILE_NAME <span class="token operator">=</span> <span class="token string">'./myfile.dat'</span><span class="token punctuation">;</span></code></pre>
      </div>
      <p>
       Similarly, you can estimate the amount of space that remains
            available in a given file by multiplying
       <code class="literal">
        FREE_EXTENTS
       </code>
       by
       <code class="literal">
        EXTENT_SIZE
       </code>
       :
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa6661385"><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> FREE_EXTENTS <span class="token operator">*</span> <span class="token keyword">EXTENT_SIZE</span> <span class="token keyword">AS</span> bytes_free
    <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES
    <span class="token keyword">WHERE</span> FILE_NAME <span class="token operator">=</span> <span class="token string">'./myfile.dat'</span><span class="token punctuation">;</span></code></pre>
      </div>
      <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Important
       </div>
       <p>
        The byte values produced by the preceding queries are
              approximations only, and their precision is inversely
              proportional to the value of
        <code class="literal">
         EXTENT_SIZE
        </code>
        . That is, the larger
        <code class="literal">
         EXTENT_SIZE
        </code>
        becomes, the less accurate
              the approximations are.
       </p>
      </div>
      <p>
       It is also important to remember that once an extent is
            used, it cannot be freed again without dropping the data
            file of which it is a part. This means that deletes from a
            Disk Data table do
       <span class="emphasis">
        <em>
         not
        </em>
       </span>
       release disk
            space.
      </p>
      <p>
       The extent size can be set in a
       <a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
        <code class="literal">
         CREATE
            TABLESPACE
        </code>
       </a>
       statement. For more information, see
       <a class="xref" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
        Section 15.1.21, “CREATE TABLESPACE Statement”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       You can obtain information about Disk Data tablespaces using
            the
       <a class="link" href="mysql-cluster-programs-ndb-desc.html" title="25.5.9 ndb_desc — Describe NDB Tables">
        <span class="command">
         <strong>
          ndb_desc
         </strong>
        </span>
       </a>
       utility. For more
            information, see
       <a class="xref" href="mysql-cluster-disk-data-objects.html" title="25.6.11.1 NDB Cluster Disk Data Objects">
        Section 25.6.11.1, “NDB Cluster Disk Data Objects”
       </a>
       , as well
            as the description of
       <a class="link" href="mysql-cluster-programs-ndb-desc.html" title="25.5.9 ndb_desc — Describe NDB Tables">
        <span class="command">
         <strong>
          ndb_desc
         </strong>
        </span>
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       For additional information, and examples of creating,
            dropping, and obtaining information about NDB Cluster Disk
            Data objects, see
       <a class="xref" href="mysql-cluster-disk-data.html" title="25.6.11 NDB Cluster Disk Data Tables">
        Section 25.6.11, “NDB Cluster Disk Data Tables”
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
