Re: OT: SQL Data Type

2007-11-28 Thread Claude Schneegans
 What are the benefits on using a CHAR field versus VARCHAR?

The basic idea, back to the first database systems, is that all records 
have the same length
and use the same amount of space in the database. Thus finding a record 
is just a matter of multiplying this
record length by the record number, and read a bunch of bytes: pretty fast.

The problem is that database may grow pretty big if large fields are 
needed, and use much empty space,
especially if many of the fields are empty, an empty field taking 
exactly as much space than a full field.

Then came the VARCHAR, AKA memo field.
The idea is to store this field in a special area where all fields have 
a specific length and occupy only the
space they need. The database then stores the address of the data in the 
record, instead of the data itself,
but the record still has the same length.

The advantage of memo fields is more efficiency in terms of disk space 
used, but it also implies a two step
process to retrieve data, then it is less efficient in terms of speed.

It is then up to the programmer to decide what type of efficiency is the 
best for his application.

General rules are:
- the larger the field must be,
- the more often this field can be empty,
then the better it is to use VARCHAR.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293911
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: OT: SQL Data Type

2007-11-28 Thread Tom Chiverton
On Wednesday 28 Nov 2007, Claude Schneegans wrote:
 It is then up to the programmer to decide what type of efficiency is the
 best for his application.

However, almost no programmers will ever have to care about the tiny 
performance changes betwen the two, in which case VARCHAR is better because 
you don't need to TRIM() everything all the time.

-- 
Tom Chiverton
Helping to completely restore best-of-breed markets
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office.  Any reference to a partner in 
relation to Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293913
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: OT: SQL Data Type

2007-11-28 Thread Jochem van Dieten
ColdFusion wrote:
 What are the benefits on using a CHAR field versus VARCHAR?

Check your database manual, the differences between implementations are 
such that for every other answer is pure speculation.

Jochem

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293914
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


OT: SQL Data Type

2007-11-27 Thread ColdFusion
What are the benefits on using a CHAR field versus VARCHAR?

 

I know with a CHAR(10) field that if the data is: START  then the actual
value is: START_ _ _ _ _ rather than a VARCHAR(10) of START.

 

 





~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293905
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4