Results 1 to 4 of 4
Thread: Field Size
May 27, 2003, 07:42 #1
- Join Date
- May 2003
- 0 Post(s)
- 0 Thread(s)
I noticed some interesting thing
When I create some field lets say of int type its size supposed to be 4 bytes. Like this
Alter table tbl_countries add country_id INT
Then I looked into the table using MySQL-Front and was amaized to find out that the field has a length of 11. From where is the addon of 7 bytes ?
If i force the size and change it to 4 it works perfectly. And the maximum value that can be in both cases is 4294967295 (unsigned) but why mysql adds those 7 bytes?
By the way the same thing is happening with tinyint which by default comes with size of 4 instead of 1.
If anyone can explain this I would be thankful.
My second question is about alter table
I want to add pack_keys=1 to some of my read only accessed tables which have numeric indexes, what is the correct alter table statement to add this option.