GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

varchar vs char

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • varchar vs char

    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

  • #2
    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)

    Comment


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

      Thanks again.

      Comment

      Working...
      X