Subject Re: [Firebird-Architect] Global Temporary Tables
Author Jim Starkey
Fabricio Araujo wrote:

>On Sun, 23 Jan 2005 22:35:25 -0500, Jim Starkey wrote:
>
>
>
>>Vlad Horsun wrote:
>>
>>
>>
>>>>> About blobs
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>> If blob stored initially in one page space and assigned to relation from
>>>another page space then we must copy blob into another page space and
>>>release pages from first page space. Proposed bpb extension allow user
>>>to avoid such copying - if user already know that blob will be assigned to
>>>temporary table then he can point engine to allocate blob in temporary page
>>>space at creation time.
>>>
>>>
>>>
>>>
>>Yes, it would be nice if an application program were to declare that a
>>blob is to go into temporary space, but given that the whole idea of
>>temporary tables is that they are transparent to the application layer
>>and tools, requiring applications and tools to take special actions just
>>isn't going to fly. How are you going to do when somebody tries to
>>assign the wrong type of blob, throw an error?
>>
>>The most common case is that data containing blobs will be copied from
>>permanent tables into a temporary table. In this case, you have no
>>choice but to copy the blob. So that leaves the far fetched case that
>>somebody does inserts containing blobs into temporary tables that we're
>>quibbling about. Can you come up with a scenario where somebody would
>>ever do that? If not, why even worry about it -- copy the blob and get
>>one with life.
>>
>>
>
>If I understand correctly all this stuff about blobs and how they work
>under the surface in the usual way, why don't do this: If the record
>get copied to a temp table and in the record have a blob field
>which have a blob pointer (or id or dbkey or what the hell you call it)
>
>to the page the little monster is stored, what just copying the
>pointer to the blob and forget that story of copying many MB from
>here to there (as blobs don't have a defined limit in theory)?
>
The show stopper among the many reasons is that the source blob may be
garbage collected while the temporary table is holding a pointer to it.

--

Jim Starkey
Netfrastructure, Inc.
978 526-1376