Description:
During benchmarks I found out setting PACK_KEYS=0 does not take any effect on the MyISAM table:
CREATE TABLE `charjoin_myisam_unpacked` (
`i` varchar(10) NOT NULL,
`c` char(10) DEFAULT NULL,
`j` varchar(10) NOT NULL,
KEY `i` (`i`),
KEY `j` (`j`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0
CREATE TABLE `charjoin_myisam` (
`i` varchar(10) NOT NULL,
`c` char(10) DEFAULT NULL,
`j` varchar(10) NOT NULL,
KEY `i` (`i`),
KEY `j` (`j`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
[root@WEB02 test]# /usr/local/mysql/bin/myisamchk -dvv charjoin_myisam_unpacked.MYI
MyISAM file: charjoin_myisam_unpacked.MYI
Record format: Packed
Character set: latin1_swedish_ci (8)
File-version: 1
Creation time: 2007-06-18 19:09:44
Recover time: 2007-06-18 19:10:10
Status: checked,analyzed
Data records: 262144 Deleted blocks: 0
Datafile parts: 262144 Deleted data: 0
Datafile pointer (bytes): 6 Keyfile pointer (bytes): 6
Datafile length: 7335528 Keyfile length: 2632704
Max datafile length: 281474976710654 Max keyfile length: 288230376151710719
Recordlength: 94
table description:
Key Start Len Index Type Rec/key Root Blocksize
1 2 30 multip. varchar prefix 3 1534976 1024
2 63 30 multip. varchar prefix 26 2631680 1024
Field Start Length Nullpos Nullbit Type
1 1 1
2 2 31 varchar
3 33 30 1 1 no endspace
4 63 31 varchar
Note it is marked varchar has preffix compression enabled
Plus tables have the same size:
-rw-rw---- 1 mysql mysql 7335528 Jun 18 15:02 charjoin_myisam.MYD
-rw-rw---- 1 mysql mysql 2632704 Jun 18 15:02 charjoin_myisam.MYI
-rw-rw---- 1 mysql mysql 8602 Jun 18 15:09 charjoin_myisam_unpacked.frm
-rw-rw---- 1 mysql mysql 7335528 Jun 18 15:10 charjoin_myisam_unpacked.MYD
-rw-rw---- 1 mysql mysql 2632704 Jun 18 15:10 charjoin_myisam_unpacked.MYI
How to repeat:
see above