Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 259.0Kb
Man Pages (Zip) - 366.2Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


17.15.1.3 Using the Compression Information Schema Tables

Example 17.1 Using the Compression Information Schema Tables

The following is sample output from a database that contains compressed tables (seeSection 17.9, “InnoDB Table and Page Compression”,INNODB_CMP,INNODB_CMP_PER_INDEX, andINNODB_CMPMEM).

The following table shows the contents ofINFORMATION_SCHEMA.INNODB_CMP under a lightworkload. The only compressed page size that the buffer pool contains is 8K. Compressing or uncompressing pages has consumed less than a second since the time the statistics were reset, because the columnsCOMPRESS_TIME andUNCOMPRESS_TIME are zero.

page sizecompress opscompress ops okcompress timeuncompress opsuncompress time
102400000
204800000
409600000
819210489210610
1638400000

According toINNODB_CMPMEM, there are 6169 compressed 8KB pages in thebuffer pool. The only other allocated block size is 64 bytes. The smallestPAGE_SIZE inINNODB_CMPMEM is used for block descriptors of those compressed pages for which no uncompressed page exists in the buffer pool. We see that there are 5910 such pages. Indirectly, we see that 259 (6169-5910) compressed pages also exist in the buffer pool in uncompressed form.

The following table shows the contents ofINFORMATION_SCHEMA.INNODB_CMPMEM under a lightworkload. Some memory is unusable due to fragmentation of the memory allocator for compressed pages:SUM(PAGE_SIZE*PAGES_FREE)=6784. This is because small memory allocation requests are fulfilled by splitting bigger blocks, starting from the 16K blocks that are allocated from the main buffer pool, using the buddy allocation system. The fragmentation is this low because some allocated blocks have been relocated (copied) to form bigger adjacent free blocks. This copying ofSUM(PAGE_SIZE*RELOCATION_OPS) bytes has consumed less than a second(SUM(RELOCATION_TIME)=0).

page sizepages usedpages freerelocation opsrelocation time
645910024360
1280100
2560000
5120100
10240000
20480100
40960100
81926169050
163840000