mysql - Disk space difference about text and varchar -
this question has answer here:
there disk space difference these 2 fields: text , varchar ?
i need use field store url hosting support varchar 333 chars.
here table:
create table if not exists `urls` ( `id` int unsigned not null auto_increment, `n_id` int unsigned not null default '0', `first_citizen_id` int unsigned not null default '0', `title_citizen` varchar(128) not null, `title_source` varchar(255) not null, `link` varchar(333) not null default '', `link_image` varchar(333) not null default '', `created` timestamp not null default current_timestamp, primary key (`id`), unique key `link` (`link`) ) engine=myisam default charset=utf8 auto_increment=1 ;
from data type storage requirements chapter:
in following table, m represents declared column length in characters nonbinary string types , bytes binary string types. l represents actual length in bytes of given string value.
varchar(m), varbinary(m)l + 1 bytes if column values require 0 – 255 bytes, l + 2 bytes if values may require more 255 bytes
blob, textl + 2 bytes, l < 216
whatever, i'm pretty sure hosting service not limiting anything. have table lots of large columns , hit maximum row size.
Comments
Post a Comment