When a row is too long, the longest columns are chosen for off-page storage until the clustered index record fits on the B-tree page.
MySQL :: MySQL 8.0 Reference Manual :: 15.10 InnoDB Row Formats https://dev.mysql.com/doc/refman/8.0/en/innodb-row-format.html
When a table is created with ROW_FORMAT=DYNAMIC
, InnoDB
can store long variable-length column values (for VARCHAR
, VARBINARY
, and BLOB
and TEXT
types) fully off-page, with the clustered index record containing only a 20-byte pointer to the overflow page. Fixed-length fields greater than or equal to 768 bytes are encoded as variable-length fields. For example, a CHAR(255)
column can exceed 768 bytes if the maximum byte length of the character set is greater than 3, as it is with utf8mb4
.
Whether columns are stored off-page depends on the page size and the total size of the row. When a row is too long, the longest columns are chosen for off-page storage until the clustered index record fits on the B-tree page. TEXT
and BLOB
columns that are less than or equal to 40 bytes are stored in line.
The DYNAMIC
row format maintains the efficiency of storing the entire row in the index node if it fits (as do the COMPACT
and REDUNDANT
formats), but the DYNAMIC
row format avoids the problem of filling B-tree nodes with a large number of data bytes of long columns. The DYNAMIC
row format is based on the idea that if a portion of a long data value is stored off-page, it is usually most efficient to store the entire value off-page. With DYNAMIC
format, shorter columns are likely to remain in the B-tree node, minimizing the number of overflow pages required for a given row.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
2021-01-27 Linux服务器内存池技术是如何实现的
2019-01-27 表达式 求值 栈应用 符合匹配 算术运算
2018-01-27 微信app端 传图 视频 在pc端同步显示
2018-01-27 t
2017-01-27 multi-paradigm 范式