Char vs. Varchar
Posted in 1994
Hello Informixers! I don't know if the discussion about the usage of varchar vs. char fields took already place here in this group. So my question: In our application which is in production since april, I defined a lot of columns as char(60). Now I see with the production data that the average length of this data is only 6-10 characters. To save space I am now thinking to change them to varchar(60). On some of these columns we have Indexes to speed up queries. My question: Are accesses through indexes on varchar columns slower than on char columns? A general question: When is it recommended to use varchar instead of char? Is there a magic number of (average string length) / (max string length) ? Is there any good reason still to use char except when I know that all records have the same length with this field? Any experience to this topic would be welcome. Achim -- ========================================================================== / Achim Reiners Software Engineering \\ | /M/A/I Deutschland GmbH | | Softwarezentrum Koeln Phone: +49 221 956400-40 | | Mathias-Brueggen-Str. 85 Fax: +49 221 956400-69 | \\ 50829 Koeln E-Mail: ar@mai.de / \\_________________________________________________________________________/