归隐乡村 发表于 2016-07-14 14:23

mysql的extents

一直以为mysqld饿extents的大小是固定的1M,今天发现不是这样的。

lyhabc 发表于 2016-07-14 22:18

本帖最后由 lyhabc 于 2016-07-14 22:19 编辑

每个extent是1MB


page,页
最小I/O单位,16KB,5.6版本起可自定义page sizeinnodb_page_size



extent,区
空间管理单位
每个extent总是1MB,由64个page组成
如果page size是8KB的话,则由128个page组成


segment,段
对象单位,例如rollback seg,undo seg,data seg,index seg等
每个segement由N个extent以及32个零散page组成
segment最小以extent为单位扩展


tablespace,表空间
表存储对象
每个tablespace都至少包含2种segement(叶子/非叶子 page file segment)



action08 发表于 2016-07-17 16:02

那你今天发现了什么意外收获??谢谢分享一下哈

归隐乡村 发表于 2016-07-18 10:07

本帖最后由 归隐乡村 于 2016-07-18 10:07 编辑

5.6上是你说的这样子的。5.7上变了。是我没描述清楚问题。

5.6中
Pages, Extents, Segments, and Tablespaces
Each tablespace consists of database pages. Every tablespace in a MySQL instance has the same page size. By default, all tablespaces have a page size of 16KB; you can reduce the page size to 8KB or 4KB by specifying the innodb_page_size option when you create the MySQL instance.
The pages are grouped into extents of size 1MB (64 consecutive 16KB pages, or 128 8KB pages, or 256 4KB pages). The “files” inside a tablespace are called segments in InnoDB. (These segments are different from the rollback segment, which actually contains many tablespace segments.)

5.7中
14.9.2 File Space Management
Pages, Extents, Segments, and Tablespaces
Each tablespace consists of database pages. Every tablespace in a MySQL instance has the same page size. By default, all tablespaces have a page size of 16KB; you can reduce the page size to 8KB or 4KB by specifying the innodb_page_size option when you create the MySQL instance. As of MySQL 5.7.6, you can also increase the page size to 32KB or 64KB. For more information, refer to the innodb_page_size documentation.

The pages are grouped into extents of size 1MB for pages up to 16KB in size (64 consecutive 16KB pages, or 128 8KB pages, or 256 4KB pages). For a page size of 32KB, extent size is 2MB. For page size of 64KB, extent size is 4MB.


回复 2# lyhabc


   
页: [1]
查看完整版本: mysql的extents