Table Space File composition structure
The InnoDB storage engine is managed by table space.
When you create a new data, the InnoDB storage engine Initializes a tablespace file named Ibdata1.
By default, this file stores data for all tables, as well as the Sys_tables, Sys_columns, Sys_indexes, Sys_fields, and so on that we are familiar with but cannot see.
In addition, it is used to store rollback data that guarantees data integrity.
Can be set by setting innodb_file_per_table so that each table corresponds to a separate tablespace file.
Paragraph
A segment is the primary organizational structure of a tablespace file, which is a logical concept that is used to manage physical files, which are the basic elements that make up an index, a table, and a rollback segment.
While creating an index (b +) tree, two segments are created, namely the inner node segment and the leaf node segment.
The volume of indexed data has been growing, and all new applications for storage space have been applied from the logical concept of paragraph.
More vividly, IBD files are made up of multiple ends, and no other space is removed from the management of the segment.
Cluster
As we already know, an index consists of two segments, and the segment is a logical concept. What does the organizational structure look like in the paragraph? InnoDB introduces the concept of clustering, which is extent in the code.
Clusters are the basic elements of the constituent segments, and a segment consists of several clusters.
A cluster is a space that is physically continuously allocated, with at least one cluster per segment, and a default cluster created when a segment is created.
If a cluster is not enough to store more data when it is stored, a new cluster will need to be allocated from that segment to hold the new data.
The size of the cluster is fixed and is typically 64 pages.
An index consists of two segments, and the physical position between the two segments is not related to each other. Each segment consists of several clusters, and the physical location of multiple clusters is not related, but there is a pointer connection.
Page
We already know the relationship between the segment and the cluster. But the inside of the cluster's physical space needs to continue to be segmented and managed efficiently.
The page is the product that the cluster is subdivided, it is the basic unit that composes the cluster.
A page is the smallest unit managed by a segment, the smallest unit of database file management, and, of course, the smallest unit of space allocation in a file.
A cluster can include multiple pages, the default being 64.
In a cluster, these page numbers are logically contiguous from small to large, and are physically contiguous.
The default size for each page is 16K.
Reading notes-mysql operation and maintenance 07-INNODB data storage structure