Subject | Re: [firebird-support] Streamed blobs versus Blobs |
---|---|
Author | Ann W. Harrison |
Post date | 2004-12-02T17:41:53Z |
At 09:11 AM 12/2/2004, Olivier Mascia wrote:
length words. Streams blobs are just data - plus page and
record overhead, as pertains.
and getb, but they're a hack on top of the stream blob calls,
not the segmented blob calls. The "real" calls are BLOB_open,
BLOB_get, BLOB_put, BLOB_close.
The getb/putb things are macros like getc and putc, that fill
and dump buffers so you're not actually making a round trip to
the database for each byte.
BLOB_open takes the handle of an open blob and creates a BSTREAM
block - a control block that manages the positioning in a stream
blob. Bopen combines that with the actual opening of the blob.
I thought it was easier to have one call. I didn't do a Bclose
because it would have exactly the same arguments and effect as
BLOB_close.
blob-id that decomposes into a record number that locates a data
page and an offset in the page/line index. The page line index
entry points to an entity with a variant of a record header called
a blob header. The data portion is either the whole blob - if
it's small, a vector of page numbers of blob pages - if it's
medium sized, or a vector of page numbers of pages of vectors of
page numbers if it's large.
The blob data, however, is different in the two cases. Segmented
blobs have segment lengths sprinkled through the data. Stream
blobs don't.
BLOB_open, BLOB_get, BLOB_put, and BLOB_close.
because of the segment boundaries.
Regards,
Ann
>What physical differences does it make to the database internals wetherAs in my earlier post, yes. Segmented blobs include segment
>a stream blob or a segmented blob is used. Is the internal storage
>really different ?
length words. Streams blobs are just data - plus page and
record overhead, as pertains.
>Though I have not yet spent the required time to verify this in the"Frosting" is a nicer word. That's true of Bopen, putb, putbx,
>source code, it looks to me that those STREAM* / Bopen / putb / putbx /
>getb / isc_seek_blob / BLOB_close are just a hack
and getb, but they're a hack on top of the stream blob calls,
not the segmented blob calls. The "real" calls are BLOB_open,
BLOB_get, BLOB_put, BLOB_close.
The getb/putb things are macros like getc and putc, that fill
and dump buffers so you're not actually making a round trip to
the database for each byte.
BLOB_open takes the handle of an open blob and creates a BSTREAM
block - a control block that manages the positioning in a stream
blob. Bopen combines that with the actual opening of the blob.
I thought it was easier to have one call. I didn't do a Bclose
because it would have exactly the same arguments and effect as
BLOB_close.
>over the basic realNo. Both types of blobs have the same basic storage mechanism - a
>blob handling which is inherently 'segment' based, at least due to page
>storage.
blob-id that decomposes into a record number that locates a data
page and an offset in the page/line index. The page line index
entry points to an entity with a variant of a record header called
a blob header. The data portion is either the whole blob - if
it's small, a vector of page numbers of blob pages - if it's
medium sized, or a vector of page numbers of pages of vectors of
page numbers if it's large.
The blob data, however, is different in the two cases. Segmented
blobs have segment lengths sprinkled through the data. Stream
blobs don't.
>Also this API seems completely built despite of any good senseGuilty.
>(I don't want to be rude on anybody by writing this, but it clearly
>looks like mess than good order).
>Not even the naming of the functionsIt was before, and it was me. There's an underlying set of calls -
>is coherent. We have Bopen but BLOB_close, we have putb/putx/getb but
>isc_seek_blob... What happened to that area of the API during the
>Borland days or before ?
BLOB_open, BLOB_get, BLOB_put, and BLOB_close.
>Am I wrong when I think that isc_seek_blob can actually be used with soHowever, it will get the wrong answer if used on a segmented blob
>called segmented blobs ? That one does not take a STREAM* but a plain
>isc_blob_handle as expected...
because of the segment boundaries.
>Is it true that a blob written using the above set of calls can later beThose work.
>retrieved using the common set of APIs (isc_create_blob2 /
>isc_open_blob2 / isc_close_blob / isc_cancel_blob / isc_blob_info
>isc_get_segment / isc_put_segment /those don't.
Regards,
Ann