What's the difference between VARCHAR and CHAR?

steven picture steven · Dec 11, 2009 · Viewed 653.9k times · Source

What's the difference between VARCHAR and CHAR in MySQL?

I am trying to store MD5 hashes.

Answer

Anon. picture Anon. · Dec 11, 2009

VARCHAR is variable-length.

CHAR is fixed length.

If your content is a fixed size, you'll get better performance with CHAR.

See the MySQL page on CHAR and VARCHAR Types for a detailed explanation (be sure to also read the comments).