It is always best to set fields sizes as small as possible, to both conserve disk space, as well as improve performance. The smaller the record the faster the queries. While you do not want to make any field too small, you also don't want to make it too big. With current databases, you can easily change field size after designing without causing major problems. Old database languages did not allow you to change field sizes on the fly. You had to redesign the database, then write a program to upgrade the database, then modify your programs to tell it the changes in your database. Consider your output, typically when printing an address onto a label, you can only write approx 35 characters, unless you are using very large shipping labels. I usually define for addresses the following:
add1 varchar(35)
add2 varchar(35)
city varchar(25)
state char(2)
zip varchar(10)


Total space 107 characters max

At 11:05 AM 11/21/2003, you wrote:
Will any names or addresses exceed 255 characters? The documentation
recommends to use the smallest column size possible.


-will


Real-time Chat: irc.freenode.net -> #mysql
( http://www.mysql.com/doc/en/IRC.html )

----- Original Message -----
From: "Paul Fine" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 21, 2003 7:34 AM
Subject: Choosing between VARCHAR and TEXT


> Can anyone tell me what is better to use for items such as names and > addresses? I suspect VARCHAR(max anticipated length) but why? Is it because > Text will pad? > > > Thanks! > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > >



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


Patrick J. Shoaf, Systems Engineer
<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]

Midmon Internet Services, LLC
100 Third Street
Charleroi, PA 15022
http://www.midmon.com
Phone: 724-483-2400 ext. 105
 or    888-638-6963
Fax:   724-489-4386



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to