Re: Informix character type- URGENT
Posted in 1997
>From: rmcall@on-ramp.ior.com (Rob J McAllister) >Date: Sun, 20 Jul 1997 06:22:44 GMT >X-Informix-List-Id: <news.40638> > >Don't forget that type TEXT uses disk a page at a time. Database >pages are typically 2K or 4K. If you are planning to use up to 1000 >bytes, type TEXT is a bad choice. True, but only if the blobs are stored in a blob space. If they are created IN TABLE, then a single page may contain more than one blob. This is suitable when there are only small blobs associated with a table; for large blobs, you should use a separate blob space. Note that blobs IN TABLE are logged via the transaction log -- blobs in a blob space are not logged via the transaction log (they are handled correctly in transactions; it just isn't done with the blob data being written directly to the logical logs themselves). >Why VARCHAR is so limited, I can't say, LVARCHAR is available in IUS and will deal with most of the problems. It allows up to 4 kB of data (according to my 9.10 manual). This is enough for most small-blob situations. >but what about splitting your data into 4 VARCHAR(255) columns ? Would >this work in you case ? What is more important Space or Time ? This has minimal overhead in the database, but is unpleasant to deal with in applications. It can be done -- I've done it -- but it still isn't particularly nice. As you say, it becomes a question of which is more important -- space or time -- but the time I'm referring to is the programmer time spent getting the code right. >satriguy@aol.com (SaTriGuy) wrote: >>>I am trying to set up a table whuch needs char(1000). Does it mean >>>DB will store 1000 bytes in DB, even though I might input only 100?. >>>I suspect this to be right, since only VARCHAR kind only takes off >>>trailing spaces. Incidentally, a VARCHAR does not have trailing blanks removed; trailing blanks are significant. But, and this is the big difference, if you ask for a string of 30 bytes to be stored, then only the count and those 30 bytes are stored in a VARCHAR column, whereas a CHAR column will be blank padded to the full length of the column. Consequently, you cannot tell which trailing blanks on a CHAR value were placed there by the user and which were placed there by the database system. >>>Anyone has definte answer on this. It is INFORMIX 7.0. > >>Yep - a CHAR is a fixed length data type. You might want to consider >>making this a TEXT type >>Madison Pruet Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> PS: Warning I do not reply to messages with anti-spam in the return path.