List:General Discussion« Previous MessageNext Message »
From:Tucker Cunningham Date:January 20 2006 12:13am
Subject:differences between varchar and text fields
View as plain text  
hi all -
   I was looking for some clarification about the difference between 
varchar and the text types in MySQL 5.0.18.  It seems to me that varchar 
and text both hold text data, are variable length, and have the same 
storage requirements (4 + L bytes).  Also, longtext adds the ability to 
hold ~4G of data at the cost of only 2 extra storage bytes?  Also, it 
looks like text data is stored externally from the table, where varchar 
is stored within its row.

So, my question is:  what are the pros and cons of using varchar vs. 
text/longtext?  Right now, longtext seems to be the best option (it 
provides most flexibility in data that can be stored, at only a 
2-byte-per-row storage premium) There must be some drawback, what am I 
missing?  Thanks for your help


Tucker Cunningham
Integration Appliance Inc.
email: tucker@stripped
cell: 650.387.5980

differences between varchar and text fieldsTucker Cunningham20 Jan
  • Re: differences between varchar and text fieldsAdam i Agnieszka GÄ…siorowski FNORD3 Apr