well, no, a Char field certainly won't take less space than Varchar but it
helps in optimizing space since mysql can manage space better when it knows
the exact length of the row. Hence, if you delete a record, instead of
leaving a hole on the disk (in Varchar), it will fill it up with another
record (when all the fields are Char) and leave no holes.
Another benefit is during recovery. If a certain sector is bad, mysql can
easily calculate where the record began, ended and move on to recover the
good records.

Regards,
Bhavin.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 3:55 PM
Subject: RE: varchar to char ...


> What do you mean by optimization of the column? Are you saying that
> char takes less space than varchar or the performance on char is better
> in queries compared with varchar ?
>
> The whole concept of "CREATE ....AS" is that you want target table to
> inherit all the properties with the data of the source tables and the
> columns. So I don't understand why should/would it change the data
> types of columns.
>
> thanks
>
> Vivek
>
> > -----Original Message-----
> > From: bvyas3 [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 14, 2002 6:36 PM
> > To: CHAUDHARY, Vivek; mysql
> > Cc: bvyas3
> > Subject: Re: varchar to char ...
> >
> >
> > Mysql optimizes the column type while creating the table.
> >
> > Regards,
> > Bhavn.
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, June 14, 2002 2:26 PM
> > Subject: varchar to char ...
> >
> >
> > > Hi guys,
> > >
> > > I have a query.I am not sure if this is a bug or a feature (ha ha
> > > ha...).
> > >
> > > Table - abc
> > >   name varchar(30),
> > >   address varchar(50)
> > >
> > > Then I run this sql.
> > >
> > > create table temp_abc as
> > > select * from abc;
> > >
> > > datatypes of the columns changes:
> > >
> > > Table - temp_abc
> > >   name char(30),
> > >   address char(50)
> > >
> > > any clues,
> > >
> > > Vivek
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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
> >
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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

Reply via email to