In MySQL5.0 I calculated the storage requirements for the below data types **in InnoDB**. Can you confirm this is correct?

http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

Did I get that right for InnoDB?

Thanks,

http://www.t1shopper.com/

http://dev.mysql.com/doc/r

```
MEDIUMINT() = 3 bytes
DECIMAL(3) = 4 bytes
DECIMAL(9) = 4 bytes
DECIMAL(10) = 5 bytes
DECIMAL(16) = 8 bytes
DECIMAL(2,2) = 8 bytes
DECIMAL(12,2) = 9 bytes
```

Did I get that right for InnoDB?

Thanks,

http://www.t1shopper.com/

Do more with

EXPERT OFFICE^{®} is a registered trademark of EXPERTS EXCHANGE^{®}

Link you provided only valid for MyISAM.

Sorry, some parts of my answer were wrong. Here are the corrections:

> > DECIMAL(2,2) = 8 bytes

> This is 2 leftover digits for each part, 1 byte for each part, so two bytes total.

This is really as decimal number with no digits before the decimal point and two digits after, so numbers from -0.99 to 0.99. With no part before the decimal point that has no space and the two leftover digits to the right take 1 byte.

> > DECIMAL(12,2) = 9 bytes

> 12 is 4 bytes plus 2 bytes for 3 leftover digits. 2 is 1 byte for the two leftover digits. 4 + 3 + 2 = 9 bytes, so OK.

This is ten digits before the decimal point, so one allocation of four bytes for nine digits plus one byte for one leftover digit. And two digits after the decimal point, so two leftover digits at one byte. A total of six bytes

## Premium Content

You need an Expert Office subscription to comment.Start Free Trial