June 4, 2006

InnoDB page size

Posted by Vadim

As maybe you know InnoDB uses hard page size 16Kb for datafiles and for buffer pool.
However this size can be changed if you need it for your workload.

go to file innobase/include/univ.i, lines:


/* 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

UNIV_PAGE_SIZE is page size (as you see - default value 16Kb). Possible values for UNIV_PAGE_SIZE is 8K, 16K, 32K, 64K. You also have to change UNIV_PAGE_SIZE_SHIFT (according comment it must be 2-logarithm of UNIV_PAGE_SIZE).
For pagesize 8K - UNIV_PAGE_SIZE_SHIFT=13, for 32K - UNIV_PAGE_SIZE_SHIFT=15 and so on.

Related posts: :MySQL Blob Compression performance benefits::The tool I’ve been waiting for years::Real-Life Use Case for “Barracuda” InnoDB File Format:
 

2 Comments »

  1. 1. peter

    Yes. Playing with different page sizes is good thing to try if you’re trying to get maximum performance. Too bad Innodb currently does not allow to specify it for table or index but it has to be global and requires server rebuild. Generally for certain OLTP workloads you might like to have smaller pages as these allow more distinct peices of data to be in buffer pool. For DSS workloads which require large scans or deal with large rows on the contrary large pages could be good to avoid fragmentation.

    Comment :: June 4, 2006 @ 11:27 am

  2. Page Size and the Five-Minute Rule…

    As the years go by, data pages on disk have to get bigger. 16 KB pages were good for databases in the late 1990’s, but today’s data pages should probably be 64 KB. Page sizes go up over time because memory gets cheaper, and disks get much larger, b…

    Trackback :: July 21, 2008 @ 9:09 pm

 



Subscribe without commenting


This page was found by: mysql page size page size mysql innodb page size innodb univ_page_siz... what it page size my...