In the last episode (May 29), living liquid | Christian Meisinger said:
> Olaf Stein wrote:
> > Because your int field always uses 4 bytes per record The varchar
> > uses length + 1 bytes
>
> i know... still i'm confused.
>
> the average length of the refurl varchar is 12 character, which means
> each row uses 12 + 3 bytes which is about 3 times the integer would
> use.
>
> i've create two tables with only the refurl columns:
>
> refurl varchar: Data 29,326.1 KiB
> Index 4,084.0 KiB
>
> refurl integer: Data 9,972.3 KiB
> Index 17,933.0 KiB
>
> so the data size is what i would expect.
> but i'm really surprised about the index size.
MySQL uses prefix compression on string indexes, so if your numbers are
mainly sequential, all but the last few characters will get omitted
from the index blocks.
http://dev.mysql.com/doc/refman/5.0/en/key-space.html
--
Dan Nelson
dnelson@stripped