InnoDB表空间及相关参数

InnoDB表空间:

    1)系统表空间
    2)独立表空间
    3)UNDO表空间    
    4)临时表空间(MySQL5.7新增)
    5)通用表空间(MySQL5.7新增)

相关参数:    
        innodb_autoextend_increment:
            1)全局、动态变量,默认值64MB,取值范围为1~1000MB。
            2)只适用于auto-extending InnoDB system tablespace file,对file-per-table tablespace files or general tablespace files无效(The initial extensions are by small amounts, after which extensions occur in increments of 4MB)
        innodb_data_file_path:
            1)全局、静态变量,默认值ibdata1:12M:autoextend。size可以用K, M or G指定。如果是KB的话,取1024的整数倍,否则会被round到MB,总大小最少要大于12M
            2)为了保证足够的空间for doublewrite buffer pages,第一个 system tablespace data file的大小这么规定:
                For an innodb_page_size value of 16KB or less, the minimum file size is 3MB.
                For an innodb_page_size value of 32KB, the minimum file size is 6MB.
                For an innodb_page_size value of 64KB, the minimum file size is 12MB.
            3)Size上限取决于操作系统,也可用裸磁盘分区作为数据文件
        innodb_file_per_table:
            1)全局、动态变量,默认值 ON(>=5.6.6),OFF(<5.6.6)
        innodb_data_home_dir:
            1)全局、静态变量,默认值是datedir。
            2)The common part of the directory path for InnoDB system tablespace data files.This setting does not affect the location of file-per-table tablespaces when innodb_file_per_table is enabled.
        innodb_temp_data_file_path:
            1)全局、静态变量,Mysql5.7.1引进,默认值是ibtmp1:12M:autoextend。
            2)格式:file_name:file_size[:autoextend[:max:max_file_size]]
            3)目前关于临时表空间只能通过innodb_temp_data_file_path定义相对路径,绝对路径的话目前还是受innodb_data_home_dir影响,没有单独的参数去定义临时表空间的存放路径。
                The full directory path for temporary tablespace data files is formed by concatenating the paths defined by innodb_data_home_dir and innodb_temp_data_file_path.
            4)The temporary tablespace is shared by all non-compressed InnoDB temporary tables. Compressed temporary tables reside in file-per-table tablespace files created in the temporary file directory, which is defined by the tmpdir configuration option.
        innodb_tmpdir:
            1)全局和会话、动态变量,Mysql5.7.11引进,默认值NULL
            2)Used to define an alternate directory for temporary sort files created during online ALTER TABLE operations that rebuild the table.
            3)If the value is NULL(the default), temporary files are created MySQL temporary directory ($TMPDIR on Unix, %TEMP% on Windows, or the directory specified by the --tmpdir configuration option)
            4)innodb_tmpdir overrides the MySQL tmpdir setting but only for online ALTER TABLE operations.
        innodb_page_size:
            1)全局、静态变量,默认值16K,Valid Values:4/8/16/32/64K(>=5.7.6)、4/8/16K(<5.7.6),写法可以为16384、16KB、6k。
            2)innodb_page_size can only be configured prior to initializing the MySQL instance and cannot be changed afterward
        innodb_file_format:
            1)全局、动态变量,Deprecated after 5.7.7,默认值 Barracuda(>=5.7.7),Antelope(<5.7.7)
            2)Enables an InnoDB file format for file-per-table tablespaces. 
                Antelope is the original InnoDB file format, which supports REDUNDANT and COMPACT row formats. 
                Barracuda is the newer file format, which supports COMPRESSED and DYNAMIC row formats.
            3)Changing the innodb_file_format setting does not affect the file format of existing InnoDB tablespace files
            4)The innodb_file_format setting does not apply to general tablespaces, which support tables of all row formats.
        innodb_default_row_format:
            1)全局、动态变量,Mysql5.7.9引进,默认值 DYNAMIC,有效值:DYNAMIC、COMPACT、REDUNDANT
            2)defines the default row format for InnoDB tables and user-created temporary tables
            3)Internal InnoDB temporary tables created by the server to process queries use the DYNAMIC row format, regardless of the innodb_default_row_format setting.
        innodb_undo_directory:
            1)全局、静态变量,If a path is not specified, undo tablespaces are created in the MySQL data directory, as defined by datadir.
            2)The path where InnoDB creates undo tablespaces.
        innodb_undo_logs:
            1)全局、动态变量,Deprecated after 5.7.19,默认值 128,取值范围为1~128。
            2)Defines the number of rollback segments used by InnoDB. The innodb_undo_logs option is an alias for innodb_rollback_segments.
        innodb_rollback_segments:
            1)全局、动态变量,默认值 128,取值范围为1~128。
            2)Defines the number of rollback segments used by InnoDB for transactions that generate undo records. 
        innodb_undo_tablespaces:
            1)全局、静态变量,Deprecated after 5.7.21,默认值 0,取值范围为0~95(>=5.7.8)、0~126(<=5.7.7)
            2)The number of undo tablespaces used by InnoDB. The default value is 0.3
            3)The initial size of an undo tablespace file depends on the innodb_page_size value. 
                For the default 16KB InnoDB page size, the initial undo tablespace file size is 10MiB. 
                For 4KB, 8KB, 32KB,and 64KB page sizes, the initial undo tablespace files sizes are 7MiB, 8MiB, 20MiB, and 40MiB,respectively.
        innodb_undo_log_truncate:
            1)全局、动态变量,Mysql5.7.5引进,默认值 OFF
            2)When enabled, undo tablespaces that exceed the threshold value defined by innodb_max_undo_log_size are marked for truncation.Only undo tablespaces can be truncated.
            3)Truncating undo logs that reside in the system tablespace is not supported. 
            For truncation to occur,there must be at least two undo tablespaces and two redo-enabled undo logs configured to use undo tablespaces.
            This means that innodb_undo_tablespaces must be set to a value equal to or greater than 2, and innodb_rollback_segments must set to a value equal to or greater than 35.
        innodb_max_undo_log_size:
            1)全局、动态变量,Mysql5.7.5引进,默认值 1073741824,取值范围为10485760~2**64-1
            2)Defines a threshold size for undo tablespaces. If an undo tablespace exceeds the threshold, it can be marked for truncation when innodb_undo_log_truncate is enabled.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值