page size
https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_page_size
https://dev.mysql.com/doc/refman/5.7/en/innodb-file-space.html
15.12.2 File Space Management
The data files that you define in the configuration file using the innodb_data_file_path configuration option form the InnoDB system tablespace. The files are logically concatenated to form the system tablespace. There is no striping in use. You cannot define where within the system tablespace your tables are allocated. In a newly created system tablespace, InnoDB allocates space starting from the first data file.
To avoid the issues that come with storing all tables and indexes inside the system tablespace, you can enable the innodb_file_per_table configuration option (the default), which stores each newly created table in a separate tablespace file (with extension .ibd). For tables stored this way, there is less fragmentation within the disk file, and when the table is truncated, the space is returned to the operating system rather than still being reserved by InnoDB within the system tablespace. For more information, see Section 15.7.4, “InnoDB File-Per-Table Tablespaces”.
You can also store tables in general tablespaces. General tablespaces are shared tablespaces created using CREATE TABLESPACE syntax. They can be created outside of the MySQL data directory, are capable of holding multiple tables, and support tables of all row formats. For more information, see Section 15.7.9, “InnoDB General Tablespaces”.
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. 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. The “files” inside a tablespace are called segments in InnoDB. (These segments are different from the rollback segment, which actually contains many tablespace segments.)
When a segment grows inside the tablespace, InnoDB allocates the first 32 pages to it one at a time. 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. Keeping the leaf nodes contiguous on disk enables better sequential I/O operations, because these leaf nodes contain the actual table 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 statement, InnoDB reports the extents that are definitely free in the tablespace. InnoDB always reserves some extents for cleanup and other internal purposes; these reserved extents are not included in the free space.
When you delete data from a table, InnoDB contracts the corresponding B-tree indexes. Whether the freed space becomes available for other users depends on whether the pattern of deletes frees individual pages or extents to the tablespace. Dropping a table or deleting all rows from it is guaranteed to release the space to other users, but remember that deleted rows are physically removed only by the purge operation, which happens automatically some time after they are no longer needed for transaction rollbacks or consistent reads. (See Section 15.3, “InnoDB Multi-Versioning”.)
How Pages Relate to Table Rows
The maximum row length is slightly less than half a database page for 4KB, 8KB, 16KB, and 32KB innodb_page_size settings. For example, the maximum row length is slightly less than 8KB for the default 16KB InnoDB page size. For 64KB pages, the maximum row length is slightly less than 16KB.
If a row does not exceed the maximum row length, all of it is stored locally within the page. If a row exceeds the maximum row length, variable-length columns are chosen for external off-page storage until the row fits within the maximum row length limit. External off-page storage for variable-length columns differs by row format:
COMPACT and REDUNDANT Row Formats
When a variable-length column is chosen for external off-page storage,
InnoDBstores the first 768 bytes locally in the row, and the rest externally into overflow pages. Each such column has its own list of overflow pages. The 768-byte prefix is accompanied by a 20-byte value that stores the true length of the column and points into the overflow list where the rest of the value is stored. See Section 15.11.4, “COMPACT and REDUNDANT Row Formats”.DYNAMIC and COMPRESSED Row Formats
When a variable-length column is chosen for external off-page storage,
InnoDBstores a 20-byte pointer locally in the row, and the rest externally into overflow pages. See Section 15.11.3, “DYNAMIC and COMPRESSED Row Formats”.
LONGBLOB and LONGTEXT columns must be less than 4GB, and the total row length, including BLOB and TEXT columns, must be less than 4GB.
page size的更多相关文章
- 使用Retrofit时出现 java.lang.IllegalArgumentException: URL query string "t={type}&p={page}&size={count}" must not have replace block. For dynamic query parameters use @Query.异常原因
/** * Created by leo on 16/4/30. */ public interface GanchaiService { @GET("digest?t={type}& ...
- Optimizing TLB entries for mixed page size storage in contiguous memory
A system and method for accessing memory are provided. The system comprises a lookup buffer for stor ...
- 解决PageHelper.startPage(page, size)后,关于PageInfo的total等属性不正确等问题
在解决PageHelper.startPage(page, size);的位置问题后,又遇到total等信息错误,主要还是不细心,两个不同的List实例化进PageInfo,不能混在一起,同时要确保这 ...
- page size == 4096 , nand size == 1GB, block size == 256kb 的ubi 文件系统制作
mkubiimg.sh 2 sudo mkfs.ubifs -F -q -r rootfs_ecm_5410 -m 4096 -e 253952 -c 3600 -o ubifs.img 3 4 ec ...
- jemalloc报 Unsupported system page size错误
- angularjs 1 开发简单案例(包含common.js,service.js,controller.js,page)
common.js var app = angular.module('app', ['ngFileUpload']) .factory('SV_Common', function ($http) { ...
- Huge Page 是否是拯救性能的万能良药?
本文将分析是否Huge Page在任何条件下(特别是NUMA架构下)都能带来性能提升. 本博客已经迁移至: http://cenalulu.github.io/ 为了更好的体验,请通过此链接阅读: h ...
- page fault rate
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION A program computes th ...
- Print a PeopleSoft Page with JavaScript
1. You will need a Long character field to hold the HTML string. You can use the delivered field HT ...
随机推荐
- 分布式事务中的2PC和3PC
分布式事务 分布式事务是指会涉及到操作多个数据库的事务.其实就是将对同一库事务的概念扩大到了对多个库的事务. 分布式事务中需要注意的是分布式系统中存在的一致性问题: CAP原则:在一个分布式系统中,C ...
- Mysql批量更新的一个坑-&allowMultiQueries=true允许批量更新
前言 实际上,我们经常会遇到这样的需求,那就是利用Mybatis批量更新或者批量插入,但是,实际上即使Mybatis完美支持你的sql,你也得看看你说操作的数据库是否支持,而阿福,最近就 ...
- dsLinq.Count() 引发了“System.NullReferenceException”类型的异常
DataTable dt = PurchaseArriveInfoBus.GetPurchaseArriveInfo(companyCD, txtArriveNo, txtTitle, txtProv ...
- Spring基础06——依赖注入的一些细节
1.字面值 可用字符串表示的值,可以通过<value>元素标签或value属性进行注入.基本数据类型及其封装类,String类等类型都可以采取字面值注入的方式.若字面值包含特殊字符,可以使 ...
- 大数据数据库HBase(二)——搭建与JavaAPI
一.搭建 1.选择一台没有ZK的机器(HBase自带ZK,可能会导致冲突) 2.选择版本2.0.5的HBase 3.解压HBase2.0.5 4.配置HBase的HBASE_HOME和path 5.修 ...
- 〇——什么是SHELL
在这段时间里中我们了解一下SHELL编程. 什么是shell shell是Linux的命令解释器,用于解释用户对操作系统的操作. 用shell解释的Linux命令有很多,可以通过cat/etc/she ...
- bzoj3011 [Usaco2012 Dec]Running Away From the Barn 左偏树
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=3011 题解 复习一下左偏树板子. 看完题目就知道是左偏树了. 结果这个板子还调了好久. 大概已 ...
- java:Conllection(List,set,get,map,subList)使用
list中的contains:是否包含指定元素 list中的SubList: 返回列表中指定的 fromIndex(包括 )和 toIndex(不包括)之间的部分视图. List<String ...
- 进程队列补充、socket实现服务器并发、线程完结
目录 1.队列补充 2.关于python并发与并行的补充 3.TCP服务端实现并发 4.GIL全局解释器锁 什么是保证线程安全呢? GIL与Lock 5.验证多线程的作用 对结论的验证: 6.死锁现象 ...
- A1009
两个多项式的乘积 两个数组,一个放多项式1,一个放结果 注意:arr2[j+exp]+=arr1[j]*coe; 因为有指数相加相同的情况下需要合并系数 #include<cstdio> ...