Unix Technical Forum

char vs. varchar

This is a discussion on char vs. varchar within the MySQL General forum forums, part of the MySQL category; --> Hi all Which of these two tables wiil yield the best performance in a table with about 6 million ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:53 AM
Alexander Lind
 
Posts: n/a
Default char vs. varchar

Hi all

Which of these two tables wiil yield the best performance in a table
with about 6 million entries (for rapid selects on either field):

table_using_char
field1 char(50),
field2 char(50),
filed 3 char(50),
separate unique indexes on all 3 fields


table_using_varchar
field1 varchar(50),
field2 varchar(50),
field3 varchar(50),
separate unique indexes on all 3 fields

My gut feeling is the char table should be faster since each record will
then be an exact length, but does this reasoning apply since I will be
indexing each field and they are also unique (so any one select will
only ever return exactly 1 or 0 results)?

Thanks
Alec
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com