Re: Char vs. Varchar
Posted in 1994
Watch out, if you load fixed field character data you will get no benefit out of using varchars. In other words, if you load a character field that consists of 4 actual characters plus 56 characters of trailing blanks, the trailing blanks will not be clipped off if you load the data into a VARCHAR. (They will be clipped off if you UNLOAD the data, however. Why this works this way is a mystery known only to Informix programmers.) Also, you will get liitle or no benefit out of VARCHARS if your total row length is > 1/2 your physical page size. This is because Informix Online checks to see whether it can fix a new row into a page by checking to see if a maximum-sized row will fit; it doesn't check the actual row size including VARCHARs. So this generally ends up to mean that you get one row per page if the maximum row size is large, even if the actual row sizes are small.