>From: "Vincent J. Buonassisi" <vjb@titan.com>
>Date: Mon, 03 Mar 1997 18:12:36 -0800
>X-Informix-List-Id: <news.34725>
>
>i would like to know how a BLOB type field is sized in a table. does
>informix have a default size, e.g., field width is initially 256 bytes
>and is kept in memory? if the size of the data being stored is greater
>than 256 does the data then tet stored in a file? i'm trying to figure
>out how much memory a table will use if the data type of one of the
>columns is BLOB.
The blob is kept in two parts. There is a 56-byte descriptor for the blob
which has a fixed size. It lives with all the other data in row, and is
the size specified by SysColumns.ColLength. The actual data for the blob
is actually stored separately from the other data in the row. If the blob
is stored IN TABLE, then the blob will occupy pages from the same tblspace
where the rest of the data is stored, but those pages will contain just
blob data -- no ordinary data. If the blob is stored in a blob space, then
that's where its stored and there isn't a whole lot more to say about it.
If you store the blob IN TABLE, then two blobs can share a partial page; if
the blobs are stored in a blob space, then (as far as I understand) each
blob is always given a separate set of blob pages from every other blob.
So, for space calculations, you need to factor in a constant 56 bytes per
row for each blob in the row, plus the data pages that will be needed to
store the actual blob data.
Incidentally, since a row cannot be more than 32767 bytes long, you can't
have more than 585 blobs in a single row -- a useless piece of OnLine
Administrivia.
I think this is covered in the manuals.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>