Home » Performance » MySQL » varchar vs char
varchar vs char [message #1559] Thu, 26 July 2007 04:32 Go to next message
kfeng  is currently offline kfeng
Messages: 2
Registered: July 2007
Junior Member
Hi,

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

Re: varchar vs char [message #1603 is a reply to message #1559 ] Thu, 16 August 2007 08:49 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 405
Registered: August 2006
Senior Member
Super Guru
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)


Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
Re: varchar vs char [message #1656 is a reply to message #1603 ] Tue, 21 August 2007 03:33 Go to previous message
kfeng  is currently offline kfeng
Messages: 2
Registered: July 2007
Junior Member
Thanks! You've confirmed the slowdown I felt after switching from varchar() to char(). I will go back to varchar().

Thanks again.
Previous Topic:Sorted index pages - physically reorder on disk?
Next Topic:need help with server architecture
Goto Forum:
  


Current Time: Fri Jul 10 03:46:13 EDT 2009

Total time taken to generate the page: 0.76652 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.