varchar vs char


I need some performance advice. If I don’t care about disk space and I only care about speed, should I be using char instead of varchar?

If it makes a difference, I am using MyISAM. Thanks in advance.

  • Ken

It makes a difference.

Benchmark to know which one for your particular app:)

Generally CHARs are only good when the columns are short, ie CHAR(20) or if there is close length of the strings stored

VARCHAR(255) storing average length of 10 usually will be faster than CHAR(255)

Thanks! You’ve confirmed the slowdown I felt after switching from varchar() to char(). I will go back to varchar().

Thanks again.