Description of InnoDB tablespace, segments, and zones

Source: Internet
Author: User

Description of InnoDB tablespace, segments, and zones

1. The tablespace is the highest level of the logic structure of the InnoDB Storage engine. All data is stored in the tablespace. By default, the InnoDB Storage engine has only one tablespace ibdata1, that is, all data is stored in this tablespace. If the innodb_file_per_table parameter is enabled, data in each table can be stored in a single tablespace.

If the innodb_file_per_table parameter is enabled, only data, indexes, and buffer Bitmap pages are stored in the tablespace memory of each table. Other data, such as undo log, Buffer Index page insertion, and system transaction information are inserted, secondary write buffering is stored in the original shared tablespace.

2. Common segments include data segments, index segments, and rollback segments.

Data Segment: leaf node of B + tree.

Index segment: Non-leaf node of B + tree.

Rollback segment: rollback segment, which manages undo log segment.

3. A zone is a space composed of consecutive pages, and its size is fixed to 1 MB. By default, the size of the InnoDB Storage engine page is 16 KB, that is, there are 64 consecutive pages in a zone.

Create table test (
Col1 int not null auto_increment,
Col2 varchar (7000 ),
Primary key (col1)

Create a test table and set the Col2 field to varchar (7000) to ensure that up to two records can be stored on one page. The ls command shows that the tablespace is 96 kb by default.

View the mysql data directory:

Select @ datadir;

System ls-lh/var/lib/mysql/db_zhang/test. ibd

This article permanently updates link:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.