from:《InnoDB Internals: InnoDB File Formats and Source Code Structure》
下面这段来自mysql fm。from:http://dev.mysql.com/doc/refman/5.0/en/innodb-file-space.html
13.2.11.2. File Space Management
The data files that you define in the configuration file form the InnoDB
tablespace. The files (innodb_data_file_path=ibdata1:1G;ibdata2:1G;ibdata3:1G;ibdata4:1G;ibdata5:1G )are logically concatenated to form the tablespace. There is no striping in use. Currently, you cannot define where within the tablespace your tables are 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 size 1MB (64 consecutive pages). The “files” inside a tablespace are called segments in InnoDB
. The term “rollback segment” is somewhat confusing because it actually contains many tablespace segments.
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 up to 4 extents at a time to a large segment to ensure good sequentiality of data.
Two segments are allocated for each index in InnoDB
. One is for nonleaf 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.
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.
下面这段来自一个网友的总结:
from:http://www.orczhou.com/index.php/2009/08/image-innodb-tablespace/