MySQL Forums
Forum List  »  InnoDB

Row size
Posted by: Steve Fink
Date: June 16, 2009 06:55PM

I have a table containing 3 integer columns, and it seems too large -- according to show table status, it averages 74 bytes per row. I would expect 18 (6 bytes for overhead, plus 4 each for the 3 columns.)

The same table using the MyISAM engine is exactly 13 bytes per row, so my calculations aren't completely crazy.

mysql> show table status like 'raw_log' \G
*************************** 1. row ***************************
Name: raw_log
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 179204703
Avg_row_length: 74
Data_length: 13413384192
Max_data_length: 0
Index_length: 3901751296
Data_free: 0
Auto_increment: NULL
Create_time: 2009-06-12 16:01:37
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Comment: InnoDB free: 5120 kB; (`field_id`) REFER `adlog/fields`(`id`)

mysql> show create table raw_log \G
*************************** 1. row ***************************
Table: raw_log
Create Table: CREATE TABLE `raw_log` (
`field_id` int(4) NOT NULL,
`field_value_id` int(11) NOT NULL,
`line_id` int(11) NOT NULL,
PRIMARY KEY (`line_id`,`field_id`),
KEY `field_id` (`field_id`),
CONSTRAINT `raw_log_ibfk_2` FOREIGN KEY (`field_id`) REFERENCES `fields` (`id`)

Options: ReplyQuote

Written By
Row size
June 16, 2009 06:55PM
June 17, 2009 10:33PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.