[MDEV-11089] Enabling page compression with ALTER TABLE does not compress existing pages Created: 2016-10-19 Updated: 2022-01-12 Resolved: 2016-10-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.1.18 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | innodb, need_feedback, page_compression | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Let's say that we create a table that does not use page compression, and we insert some data:
And then let's say that we want to enable page compression for this table:
Many users would expect the table's existing pages to be compressed after this point, but it appears that they are not:
Is this a bug, or a known limitation of page compression? If it's the latter, then it would be good to have that documented: https://mariadb.com/kb/en/mariadb/compression/ I do see that new inserts into the table do result in compressed pages:
|
| Comments |
| Comment by Elena Stepanova [ 2016-10-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Works for me:
Could you please attach the output from SHOW VARIABLES and SHOW GLOBAL STATUS from the session where you are performing your test? | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-10-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi elenst, It looks as though there is a delay in the pages getting compressed for me:
Is this because it takes time for the pages to be flushed to disk? I'll attach that information for you. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-10-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Dirty pages after compression are not flushed to the disk immediately, when they are flushed depends the size of the buffer pool and setting for percentage of dirty pages. Compression happens only before dirty pages are flushed to the disk thus innodb_num_pages_page_compressed could be zero after alter table. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by VAROQUI Stephane [ 2022-01-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
please innodb_max_dirty_pages_pct=0 if you wan't to see the effect of page compression right away |