(mysql.info.gz) InnoDB File space
Info Catalog
(mysql.info.gz) InnoDB Raw Devices
(mysql.info.gz) File space management
(mysql.info.gz) InnoDB File Defragmenting
15.15.3 File Space Management
-----------------------------
The data files you define in the configuration file form the tablespace
of `InnoDB'. The files are simply concatenated to form the tablespace.
There is no striping in use. Currently you cannot define where in the
tablespace your tables will be allocated. However, in a newly created
tablespace, `InnoDB' allocates space starting from the first data file.
The tablespace consists of database pages with a default size of 16KB.
The pages are grouped into extents of 64 consecutive pages. The "files"
inside a tablespace are called segments in `InnoDB'. The name of the
"rollback segment" is somewhat confusing because it actually contains
many segments in the tablespace.
Two segments are allocated for each index in `InnoDB'. One is for
non-leaf nodes of the B-tree, the other is for the leaf nodes. The idea
here is to achieve better sequentiality for the leaf nodes, which
contain the data.
When a segment grows inside the tablespace, `InnoDB' allocates the
first 32 pages to it individually. After that `InnoDB' starts to
allocate whole extents to the segment. `InnoDB' can add to a large
segment up to 4 extents at a time to ensure good sequentiality of data.
Some pages in the tablespace contain bitmaps of other pages, and
therefore a few extents in an `InnoDB' tablespace cannot be allocated
to segments as a whole, but only as individual pages.
When you ask for available free space in the tablespace by issuing a
`SHOW TABLE STATUS', `InnoDB' reports the extents that are definitely
free in the tablespace. `InnoDB' always reserves some extents for
clean-up and other internal purposes; these reserved extents are not
included in the free space.
When you delete data from a table, `InnoDB' will contract the
corresponding B-tree indexes. It depends on the pattern of deletes
whether that frees individual pages or extents to the tablespace, so
that the freed space becomes available for other users. Dropping a
table or deleting all rows from it is guaranteed to release the space
to other users, but remember that deleted rows will be physically
removed only in an (automatic) purge operation after they are no longer
needed in transaction rollback or consistent read.
Info Catalog
(mysql.info.gz) InnoDB Raw Devices
(mysql.info.gz) File space management
(mysql.info.gz) InnoDB File Defragmenting
automatically generated byinfo2html