MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disadvantages of Usage of VARCHAR

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Tanuj
Beginner


Joined: 27 Feb 2004
Posts: 5
Topics: 3

PostPosted: Fri Feb 27, 2004 2:48 am    Post subject: Disadvantages of Usage of VARCHAR Reply with quote

Hi, Could an body please let me know what are the disadvantges of using a VARCHAR instead of CHAR in DB2, specially in case where VARCHAR is defined more than 255 length.
I have read that if VARCHAR is defined more than 255 length, then this may cause perforamance realted issue, when VARCHAR is fetched via SELECT Query due repetitive compression and Decompression of VARCHAR String.
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Fri Feb 27, 2004 4:47 am    Post subject: Reply with quote

For strings longer than 255 characters there is no alternative for using VARCHAR.

The only argument for using VARCHARs shorter than 255 was space efficiency. But coding for VARCHAR columns in statis SQL is anoying, and with the compression functionality for tablespaces that space argument is gone.

regards
Christian
Back to top
View user's profile Send private message
Anovice
Beginner


Joined: 18 Feb 2004
Posts: 12
Topics: 2

PostPosted: Fri Feb 27, 2004 5:37 am    Post subject: Reply with quote

It is generally a good design to have varchar columns as the last columns in the table. DB2 maintains offsets for where each column begins for every table. If there are varchars in the middle then DB2 will have to calculate these offsets every time the column in accessed and it causes performance problems.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group