middasgoldtouch wrote:

As I understand how BLOBs work, the data goes into a different table and there is an address pointing to that table in the record. Would this mean it is possible to assign the same BLOB value to multiple records without adding the BLOB data every time?

Ann W. Harrison answers:

As Helen's book will explain, Firebird BLOBS don't go in a different table, but in what is effectively a different record. If they're small, they go on the same data page with the main record. If they're large, they go on a page by themselves. If they don't fit on a single page, they start with an array of page numbers, then get dumped onto those pages. If the array is larger than a page, the blob is represented as an array of page numbers where each page contains an array of blob data pages.

You can't share a blob between different records or records in different tables - that would require bookkeeping so that the shared blob doesn't go away before the last reference to it - but blobs are shared between versions of a single record. If you update a record with a blob but don't update the blob, you don't get a second copy of the blob.

Like this post? Share on: TwitterFacebookEmail

Related Articles


Firebird Community



Gems from Firebird Support list