content_image/777822.jpg
## NDB Notes 

AUTOEXTEND_SIZE, DATA_FREE, STATUS FROM INFORMATION_SCHEMA.FILES WHERE ENGINE=’InnoDB’\G 

•The FILES  table provides information about Disk Data files  only; you cannot use it for determining disk space allocation or availability for individual NDB  tables. However, it is possible to see how much space is allocated for each NDB  table having data stored on disk—as well as how much remains available for storage of data on disk for that table—using ndb_desc . 

•The CREATION_TIME , LAST_UPDATE_TIME , and LAST_ACCESSED  values are as reported by the operating system, and are not supplied by the NDB  storage engine. Where no value is provided by the operating system, these columns display NULL . 

•The difference between the TOTAL EXTENTS  and FREE_EXTENTS  columns is the number of extents currently in use by the file: 

SELECT TOTAL_EXTENTS - FREE_EXTENTS AS extents_used FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = ’./myfile.dat’; 

To approximate the amount of disk space in use by the file, multiply that difference by the value of the EXTENT_SIZE  column, which gives the size of an extent for the file in bytes: 

SELECT (TOTAL_EXTENTS - FREE_EXTENTS) * EXTENT_SIZE AS bytes_used FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = ’./myfile.dat’; 

Similarly, you can estimate the amount of space that remains available in a given file by multiplying FREE_EXTENTS  by EXTENT_SIZE : 

SELECT FREE_EXTENTS * EXTENT_SIZE AS bytes_free FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = ’./myfile.dat’; 

<img src='content_image/777822.jpg'>

## Important 

The byte values produced by the preceding queries are approximations only, and their precision is inversely proportional to the value of EXTENT_SIZE . That is, the larger EXTENT_SIZE  becomes, the less accurate the approximations are. 

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 not  release disk space. 

The extent size can be set in a CREATE TABLESPACE  statement. For more information, see Section 13.1.21, “CREATE TABLESPACE Statement” . 

•Prior to NDB 8.0.13, an additional row was present in the FILES  table following the creation of a logfile group, having NULL  in the FILE_NAME  column. In NDB 8.0.13 and later, this row— which did not correspond to any file—is no longer shown, and it is necessary to query the ndbinfo.logspaces  table to obtain undo log file usage information. See the description of this table as well as Section 23.5.10.1, “NDB Cluster Disk Data Objects” , for more information. 

The remainder of the discussion in this item applies only to NDB 8.0.12 and earlier. For the row having NULL  in the FILE_NAME  column, the value of the FILE_ID  column is always 0 , that of the FILE_TYPE column is always UNDO LOG , and that of the STATUS  column is always NORMAL . The value of the ENGINE  column is always ndbcluster . 

