Hi, 

Char columns are used with fixed-length type table, whereas varchar are used 
with dynamic table. If you have varchar columns in your table, all char 
columns will be convert to varchar column (you can't have a fixed-length 
table if your table contain varchar, blob or text field).

Here are the property of static table :


All CHAR, NUMERIC, and DECIMAL columns are space-padded to the column width. 
Very quick. 
Easy to cache. 
Easy to reconstruct after a crash, because records are located in fixed 
positions. 
Doesn't have to be reorganized (with myisamchk) unless a huge number of 
records are deleted and you want to return free disk space to the operating 
system. 
Usually requires more disk space than dynamic tables. 


Jocelyn Fournier
Presence-PC
www.presence-pc.com

Dans un e-mail daté du 07/05/2001 23:42:12 Paris, Madrid (heure d'été), 
[EMAIL PROTECTED] a écrit :


> Sujet :char -> varchar ?
> Date :07/05/2001 23:42:12 Paris, Madrid (heure d'été)
> From:    [EMAIL PROTECTED] (Alec Solway)
> To:    [EMAIL PROTECTED]
> 
> 
> 
> 
> Hi,
> 
> In various create table statements char columns are converted to varchar.. 
> I was wondering why this was happening. Here's an example:
> 
> CREATE TABLE realtors(name VARCHAR(255) not null, address VARCHAR(255) not 
> null, city VARCHAR(255) not null, state CHAR(2) not null, country CHAR(2) 
> not null, zip CHAR(5) not null, phone VARCHAR(50) not null, cell 
> VARCHAR(50) not null, fax VARCHAR(50) not null, nvio VARCHAR(25) not null, 
> estlead CHAR(5) not null, servicearea VARCHAR(255) not null);
> Query OK, 0 rows affected (0.11 sec)
> 
> Here, zip and estlead have been converted to varchar(5).
> 
> 
> Thanks.
> Alec 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 
> ----------------------- Headers --------------------------------
> Return-Path: <[EMAIL PROTECTED]>
> Received: from  rly-yh05.mx.aol.com (rly-yh05.mail.aol.com [172.18.147.37]) 
> by air-yh03.mail.aol.com (v77_r1.36) with ESMTP; Mon, 07 May 2001 17:42:12 
> 2000
> Received: from  web.mysql.com (web.mysql.com [192.58.197.162]) by 
> rly-yh05.mx.aol.com (v77_r1.36) with ESMTP; Mon, 07 May 2001 17:41:38 -0400
> Received: (qmail 17223 invoked by uid 7797); 7 May 2001 21:36:06 -0000
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
> (http://www.ezmlm.org)
> List-ID: <mysql.mysql.com>
> Precedence: bulk
> List-Help: <mailto:[EMAIL PROTECTED]>
> List-Unsubscribe: <mailto:[EMAIL PROTECTED]
> >
> List-Post: <mailto:[EMAIL PROTECTED]>
> List-Subscribe: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 17209 invoked from network); 7 May 2001 21:36:04 -0000
> Message-Id: <[EMAIL PROTECTED]>
> X-Sender: [EMAIL PROTECTED]
> X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
> Date: Mon, 07 May 2001 16:38:40 -0500
> To: [EMAIL PROTECTED]
> From: Alec Solway <[EMAIL PROTECTED]>
> Subject: char -> varchar ?
> Mime-Version: 1.0
> Content-Type: text/plain; charset="us-ascii"; format=flowed
> 
> 
> 


Reply via email to