Bug #29183 Disabling MyISAM packing does not work in MySQL 5.1
Submitted: 18 Jun 2007 19:20 Modified: 29 Feb 2008 17:57
Reporter: Peter Zaitsev (Basic Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.1.18, 5.0, 4.1 OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any
Tags: qc
Triage: D3 (Medium)

[18 Jun 2007 19:20] Peter Zaitsev
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
[19 Jun 2007 7:51] Sveta Smirnova
Thank you for the report.

Verified as described.
[29 Feb 2008 8:34] Ramil Kalimullin
I couldn't repeat the issue using the last 5.x/6.0 sources.
Sveta, please reverify.
[29 Feb 2008 17:57] Sveta Smirnova
I can not repeat it with current sources too.