Re: why use CHAR.. _EVER_?
- From: "aaron.kempf@xxxxxxxxx" <aaron.kempf@xxxxxxxxx>
- Date: 2 Oct 2006 12:06:29 -0700
I just don't see the point in having 20 fields that are all varchar(50)
when they only hold data that is 10 characters long.
stuff like keys?
i personally think that all keys everywhere should always be an
integer-- or preferably smallint--
it just drives me crazy; i've noted some definite peculiarities
like i've got field1 = 'aaron ' stored in a table; if i search
using a query where field1 = 'aaron' it finds a match; is this
implicit?
does it automatically do a right trim on everything you do in a char
field?
i just dont understand why 'aaron' matches to 'aaron '
it just seems inconsistent the way that they do it.
-Aaron
Russ Rose wrote:
<dbahooker@xxxxxxxxxxx> wrote in message
news:1159570979.959302.321990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
can someone list some good reasons for using CHAR?
i mean seriously here.
I've got this 3rd party database that's got EVERY SINGLE TEXT FIELD
uses CHAR instead of VarChar.
it's slow as a dog..
does anyone know why ANYONE EVER USERS CHAR?
The funniest thing I have ever seen in a database design is a bunch of
varchar(1) columns...
When a column is a fixed width it is easier for a seek algorithm to find the
data within a row, which is why is is best to have variable length columns
at the end of the table.
Fixed length columns are best for data that will hold a required value of a
specific length. The best example of this is ZIPCode (not postal code) where
it is always 5 characters and you want to preserve any leading 0's.
I doubt the difference between char and varchar is the reason for your
performance issue.
.
- Follow-Ups:
- Re: why use CHAR.. _EVER_?
- From: Mike C#
- Re: why use CHAR.. _EVER_?
- From: Ed Murphy
- Re: why use CHAR.. _EVER_?
- References:
- why use CHAR.. _EVER_?
- From: dbahooker
- Re: why use CHAR.. _EVER_?
- From: Russ Rose
- why use CHAR.. _EVER_?
- Prev by Date: CAST or CONVERT during UPDATE
- Next by Date: Re: CAST or CONVERT during UPDATE
- Previous by thread: Re: why use CHAR.. _EVER_?
- Next by thread: Re: why use CHAR.. _EVER_?
- Index(es):
Relevant Pages
|