Re: Using CHAR /LVARCHAR datatype in Informix
Posted in 2003
rkusenet wrote: > "Jonathan Leffler" <jleffler@earthlink.net> wrote >>Upgrade to IDS 9.40 and use LVARCHAR up to 32 KB (minus a bit). > > 32KB!!! cool. 32KB should statisfy almost all free text requirement > for which in versions earlier than 9.4 we have no option other than > a TEXT field. > > Can anyone elucidate the pros and cons of using LVARCHAR to store > a big char field as oppose to a TEXT field. I am paritcularly > interested in knowing how INFORMIX stores a LVARCHAR field. If you've got 20 KB of other data in the row, then your LVARCHAR is limited to between 11 and 12 KB. The data is stored inline, just as a 2 KB column is/was. The pros are that you have a regular row with less peculiar logging characteristics, and you have regular character literals for the column. The cons are primarily that your data will be logged (and may therefore use more logical log) than with a text field, and if you ever need more than 31 KB of data, you still have to go to a TEXT field. You also need to use the correct syntax - LVARCHAR(30720) for example. Plain LVARCHAR is still a 2 KB unit. Note that you can also specify smaller-than-2KB columns which can be a benefit sometimes. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/