[MDEV-8266] Page compressed doesn't work Created: 2015-06-04  Updated: 2015-06-04  Resolved: 2015-06-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Daniel Cheung Assignee: Jan Lindström (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Red Hat Enterprise Linux Server release 6.5



 Description   

I want to try the page compressed, but I can't see the effect.
This is my steps.

MariaDB [test]> set global innodb_file_format=Barracuda;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> set global innodb_compression_algorithm=zlib;
Query OK, 0 rows affected (0.00 sec)

I create a table to test the page compressed.

MariaDB [test]> CREATE TABLE `T1` ( `a` int(11) DEFAULT NULL ) engine=innodb page_compressed=1;
Query OK, 0 rows affected (0.01 sec)

And I check the variables and status.

MariaDB [test]> show variables like '%compress%';
+-------------------------------------------+-------+
| Variable_name                             | Value |
+-------------------------------------------+-------+
| have_compress                             | YES   |
| innodb_background_scrub_data_compressed   | OFF   |
| innodb_background_scrub_data_uncompressed | OFF   |
| innodb_compression_algorithm              | zlib  |
| innodb_compression_failure_threshold_pct  | 5     |
| innodb_compression_level                  | 6     |
| innodb_compression_pad_pct_max            | 50    |
| innodb_immediate_scrub_data_uncompressed  | OFF   |
| innodb_log_compressed_pages               | OFF   |
| slave_compressed_protocol                 | OFF   |
+-------------------------------------------+-------+

MariaDB [test]> SHOW STATUS LIKE '%compress%';
+------------------------------------------+-------+
| Variable_name                            | Value |
+------------------------------------------+-------+
| Compression                              | OFF   |
| Innodb_page_compression_saved            | 0     |
| Innodb_page_compression_trim_sect512     | 0     |
| Innodb_page_compression_trim_sect1024    | 0     |
| Innodb_page_compression_trim_sect2048    | 0     |
| Innodb_page_compression_trim_sect4096    | 0     |
| Innodb_page_compression_trim_sect8192    | 0     |
| Innodb_page_compression_trim_sect16384   | 0     |
| Innodb_page_compression_trim_sect32768   | 0     |
| Innodb_num_pages_page_compressed         | 0     |
| Innodb_num_page_compressed_trim_op       | 0     |
| Innodb_num_page_compressed_trim_op_saved | 0     |
| Innodb_num_pages_page_decompressed       | 0     |
| Innodb_num_pages_page_compression_error  | 0     |
| Innodb_defragment_compression_failures   | 0     |
+------------------------------------------+-------+

MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES;
+-------+-------------+------+-------------+------------+-----------+---------------+
| SPACE | NAME        | FLAG | FILE_FORMAT | ROW_FORMAT | PAGE_SIZE | ZIP_PAGE_SIZE |
+-------+-------------+------+-------------+------------+-----------+---------------+
|   145 | test/T1     |  865 | Barracuda   | Dynamic    |     16384 |             0 |
+-------+-------------+------+-------------+------------+-----------+---------------+

Then I insert 100MB data into T1 and check the status again.

MariaDB [test]> SHOW STATUS LIKE '%compress%';
+------------------------------------------+-------+
| Variable_name                            | Value |
+------------------------------------------+-------+
| Compression                              | OFF   |
| Innodb_page_compression_saved            | 0     |
| Innodb_page_compression_trim_sect512     | 0     |
| Innodb_page_compression_trim_sect1024    | 0     |
| Innodb_page_compression_trim_sect2048    | 0     |
| Innodb_page_compression_trim_sect4096    | 0     |
| Innodb_page_compression_trim_sect8192    | 0     |
| Innodb_page_compression_trim_sect16384   | 0     |
| Innodb_page_compression_trim_sect32768   | 0     |
| Innodb_num_pages_page_compressed         | 0     |
| Innodb_num_page_compressed_trim_op       | 0     |
| Innodb_num_page_compressed_trim_op_saved | 0     |
| Innodb_num_pages_page_decompressed       | 0     |
| Innodb_num_pages_page_compression_error  | 0     |
| Innodb_defragment_compression_failures   | 0     |
+------------------------------------------+-------+

Why all the status still 0?
I see the status of Compression is OFF.
My step is it correct or not ?



 Comments   
Comment by Jan Lindström (Inactive) [ 2015-06-04 ]

Duplicate of MDEV-8250.

Comment by Jan Lindström (Inactive) [ 2015-06-04 ]

Note that you need to insert at least one row and wait a while to get it asynchronously written to disk. Make sure that you have innodb-use-native-aio = 1.

Generated at Thu Feb 08 07:25:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.