Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 23, 2017 10:13 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Change CHAR to VARCHAR when both are used in same table.
PostPosted: Thu Dec 31, 2009 4:06 pm 
Offline
User avatar

Joined: Sun Mar 19, 2006 3:13 pm
Posts: 123
Location: English Indiana, USA
Hi

Data type CHAR makes searches and querying for data faster but this benefit is canceled out when CHAR is used in the same table with VARCHAR. In cases where Data length are not the same in each record VARCHAR can save significant space over CHAR. For this reason its generally a good idea to use VARCHAR where there are no benefits of using CHAR.

The only time CHAR uses the same or less space than VARCHAR, is when all records have the exact data length in the CHAR field and the CHAR clolumn length is set the same as the data going in or not set more than one character greater.

The table cc_call_archive contains no VARCHAR so I assume this was to increase the search speed however this table may contain million of records and if this be the case the extra storage being used will be significant. Careful consideration should be used in this table on deciding which is best when using CHAR or VARCHAR.
Depending on how often searches are done on this table using VARCHAR might be a better choice.

The same consideration should be taken for any table likely to contain lots of records

Sam


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group