| 1 |
select @@global.innodb_log_compressed_pages into @save_innodb_log_compressed_pages; |
| 2 |
SET @@global.innodb_log_compressed_pages=1; |
| 3 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 4 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 5 |
CREATE TABLE t ( |
| 6 |
a INT, |
| 7 |
b VARCHAR(512), |
| 8 |
c VARCHAR(16), |
| 9 |
PRIMARY KEY (a), |
| 10 |
INDEX (b(512)), |
| 11 |
INDEX (c(16)) |
| 12 |
) charset latin1 ENGINE=INNODB KEY_BLOCK_SIZE=2; |
| 13 |
SELECT |
| 14 |
database_name, |
| 15 |
table_name, |
| 16 |
index_name, |
| 17 |
compress_ops, |
| 18 |
compress_ops_ok, |
| 19 |
uncompress_ops |
| 20 |
FROM information_schema.innodb_cmp_per_index |
| 21 |
ORDER BY 1, 2, 3; |
| 22 |
database_name test |
| 23 |
table_name t |
| 24 |
index_name b |
| 25 |
compress_ops 1 |
| 26 |
compress_ops_ok 1 |
| 27 |
uncompress_ops 0 |
| 28 |
database_name test |
| 29 |
table_name t |
| 30 |
index_name c |
| 31 |
compress_ops 1 |
| 32 |
compress_ops_ok 1 |
| 33 |
uncompress_ops 0 |
| 34 |
database_name test |
| 35 |
table_name t |
| 36 |
index_name PRIMARY |
| 37 |
compress_ops 1 |
| 38 |
compress_ops_ok 1 |
| 39 |
uncompress_ops 0 |
| 40 |
BEGIN; |
| 41 |
COMMIT; |
| 42 |
ALTER TABLE t DROP INDEX c; |
| 43 |
CREATE USER 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq'; |
| 44 |
FLUSH PRIVILEGES; |
| 45 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 46 |
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation |
| 47 |
DROP USER 'tuser01'@'localhost'; |
| 48 |
SELECT |
| 49 |
database_name, |
| 50 |
table_name, |
| 51 |
index_name, |
| 52 |
CASE WHEN compress_ops=47 and @@innodb_compression_level IN (4,8,9) THEN 65 |
| 53 |
ELSE compress_ops END as compress_ops, |
| 54 |
CASE WHEN compress_ops_ok=47 and @@innodb_compression_level IN (4,8,9) THEN 65 |
| 55 |
ELSE compress_ops_ok END as compress_ops_ok, |
| 56 |
uncompress_ops |
| 57 |
FROM information_schema.innodb_cmp_per_index |
| 58 |
ORDER BY 1, 2, 3; |
| 59 |
database_name test |
| 60 |
table_name t |
| 61 |
index_name b |
| 62 |
compress_ops 43 |
| 63 |
compress_ops_ok 43 |
| 64 |
uncompress_ops 0 |
| 65 |
database_name test |
| 66 |
table_name t |
| 67 |
index_name PRIMARY |
| 68 |
compress_ops 65 |
| 69 |
compress_ops_ok 65 |
| 70 |
uncompress_ops 0 |
| 71 |
SET GLOBAL innodb_log_compressed_pages=@save_innodb_log_compressed_pages; |
| 72 |
DROP TABLE t; |
| 73 |
SET GLOBAL innodb_cmp_per_index_enabled=default; |