We know that the InnoDB data page is 16K, and is a hard rule, the system does not change the way, I hope that in the future, MySQL can also support the size of a variety of data pages.
But in practical applications sometimes the 16K is a bit large, especially if many businesses are moving to MySQL when Oracle or SQL Server is doing well and finding IO growth too obvious,
You'll want to change the size of the data page.
Actually InnoDB's data page size can also be changed, just need to change in the source layer, and then rebuild MySQL again.
Ways to change:
(Take MySQL-5.1.38 source code as an example)
Position in Storage/innobase/include/univ.i, find in UNIV.I: univ_page_size
/*
Database VERSION Control ======================== * * * The
Universal page size of the database */
#define UNIV_PAGE_SIZE (2 * 8192)/* note! Currently, this has is a power of
2 *
///* The 2-logarithm of univ_page_size: * *
#define Univ_page_size_shif T/
* Maximum number of parallel threads in a parallelized operation/
#define Univ_max_parallelism 32
The univ_page_size is the data page size, and the default is 16K. The following note indicates that the value can be set to a second party that must be 2. For this value can be set to 4k,8k,16k,32k,64k, there is no meaning in the big.
When you change the univ_page_size, you need to change the univ_page_size_shift the number of times the value is 2 is univ_page_size, so set the data page as follows:
#define Univ_page_size_shift an If univ_page_siz=4k
#define Univ_page_size_shift if univ_page_siz=8k
# Define Univ_page_size_shift if univ_page_siz=32k
Example:
Change the data page for InnoDB to 8K, and modify it accordingly:
/*
Database VERSION Control ======================== * * * The
Universal page size of the database */
#define Univ_page_size 8192/ * note! Currently, this has is a power of
2 *
///* The 2-logarithm of univ_page_size: * *
#define Univ_page_size_s Hift/
* Maximum number of parallel threads in a parallelized operation/
#define Univ_max_parallelism 32
Recompile, then test the test, and then test. Good luck!