时间:2021-07-01 10:21:17 帮助过:18人阅读
/* DATABASE VERSION CONTROL ======================== */ /* The universal page size of the database */ #define UNIV_PAGE_SIZE (2 * 8192) /* NOTE! Currently, this has to be a power of 2 */ /* The 2-logarithm of UNIV_PAGE_SIZE: */ #define UNIV_PAGE_SIZE_SHIFT 14 /* Maximum number of parallel threads in a parallelized operation */ #define UNIV_MAX_PARALLELISM 32
UNIV_PAGE_SIZE就是数据页大小,默认的是16K. 后面的备注里标明,该值是可以设置必须为2的次方。对于该值可以设置成4k,8k,16k,32K,64K,在大也没意义了。
同时更改了UNIV_PAGE_SIZE后需要更改 UNIV_PAGE_SIZE_SHIFT 该值是2的多少次方为UNIV_PAGE_SIZE,所以设置数据页分别情况如下:
#define UNIV_PAGE_SIZE_SHIFT 12 if UNIV_PAGE_SIZ=4K #define UNIV_PAGE_SIZE_SHIFT 13 if UNIV_PAGE_SIZ=8K #define UNIV_PAGE_SIZE_SHIFT 15 if UNIV_PAGE_SIZ=32K
例子:
更改innodb的数据页为8K,相应修改为:
/* DATABASE VERSION CONTROL ======================== */ /* The universal page size of the database */ #define UNIV_PAGE_SIZE 8192 /* NOTE! Currently, this has to be a power of 2 */ /* The 2-logarithm of UNIV_PAGE_SIZE: */ #define UNIV_PAGE_SIZE_SHIFT 13 /* Maximum number of parallel threads in a parallelized operation */ #define UNIV_MAX_PARALLELISM 32
重新编译,然后测试测试,再测试。Good luck!