Click to See Complete Forum and Search --> : optimising columns


Sid3335
10-18-2006, 05:06 AM
I have a couple of columns in my (mysql) db, 2 in particular are text fields that are no longer than 8 characters.

at present i am using a varchar data type.

would it be better to choose another data type, will i get any benefit from using another datatype?

i should point out that my scripts aren't that slow using this table, it's jsut it is 20+ million rows (doesn't change) and was just trying to optimise it for speed.

thanks guys

pcthug
10-18-2006, 05:23 AM
I think the only other applicable data type you may want to employ is the TINYTEXT type. However, I can see no real advantages over your current data type (VARCHAR).

NogDog
10-18-2006, 10:22 AM
If the vast majority of the values will consist of 8 or maybe 7 characters, then you may get a performance boost by using CHAR(8) instead of VARCHAR(8). If the values are more-or-less evenly distributed from 0 to 8 characters, then the table size reduction achieved by using VARCHAR may be more important.

Sid3335
10-20-2006, 03:50 AM
Thanks guys