背景
binlog_row_image这个参数是MySQL5.6新增的参数,默认值是FULL,在5.7版本默认值也是FULL,但今天我看到有客户的 MySQL5.7版本参数模板采用的是MINIMAL而不是FULL,我对这个修改表示疑惑。
一般来说,对一个参数默认值作出修改,我们都应该考虑清楚影响范围,所以我准备做一次测试,并得出结论哪个参数值才是最佳设置。
术语解释
前提:
binlog格式必须为row格式或者mixed格式,不可以是statement格式。
名称解释:
before image:前镜像,即数据库表中修改前的内容。
after image:后镜像,即数据库表中修改后的内容。
binlog_row_image三种设置及异同
binlog_row_image参数可以设置三个合法值: FULL、MINIMAL、NOBLOB
三个不同值的作用如下:
FULL: Log all columns in both the before image and the after image.
binlog日志记录所有前镜像和后镜像。
MINIMAL: Log only those columns in the before image that are required to identify the row to be changed; log only those columns in the after image where a value was specified by the SQL statement, or generated by auto-increment.
binlog日志的前镜像只记录唯一识别列(唯一