Re: CHAR() v. VARCHAR()
Posted in 1995
} } We are using Informix 7.01. We are using PowerBuilder for developing } client/server applications. PowerBuilder does not strip the padding off } of the CHAR columns when rows are added to a DataWindow. } } Our DBA claims that VARCHAR() is much less efficient than CHAR(). Yet, } he claims that both are fixed length columns with null terminated string } data. He claims that Informix pads the CHAR() columns either at the time } of the SELECT or at the time of transmission to the client. If both are } null terminated strings in storage and the CHAR() is padded when } retrieved, why would CHAR be more efficient for storage of string data. } It would seem that padding the data at the time of retrieval would make } CHAR() less efficient re. server resources than VARCHAR(). He is wrong, CHAR data types are stored in their full length in the database table, a VARCHAR is implemented as a fixed length pointer in the record, my experience has been that there is no appreciable difference in performance although it could reasonably be argued that a VARCHAR is slower due to extra disk activity... Mike } } I can appreciate that most SQL servers store VARCHAR() data less } efficiently than CHAR() data but VARCHAR() has a very different meaning } on most SQL servers (i.e., equivalent to Informix TEXT with a maximum } length specified). } } We need to decide whether it is better to store our string information as } either CHAR() or VARCHAR() under Informix. } } Thanks in advance. } } Mitch }