Re: Fast access to a BLOB

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 9 Jul 1999 16:02:43 +0100
Message-ID: <931532844.28.1.nnrp-13.9e984b29_at_news.demon.co.uk>


[Quoted] Do you have an index on the ObjID, or does the code have to do a tablescan to get to the Lob Locator ?

[Quoted] Are your LOBs stored out of line or would such a tablescan have to plough through lots of chained rows of LOB data ?

[Quoted] What is the Oracle block size - is it engineered to be appropriate to the LOB size ?

--

Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk

Matthias Späth wrote in message <7m52il$2m6t$1_at_news.karlsruhe.punkt.de>...

>Hi,
>
>how can I tune the access to a BLOB. At this time I use this Pro*C/C++
Code:
>(this code needs about 1 second for a BLOB of less then 10k in a table of 3
>columns (2 VARCHAR(256) and a BLOB) and about 10000 rows !!!)
>
>EXEC SQL AT :conn ALLOCATE :blob;
>EXEC SQL AT :conn SELECT data INTO :blob FROM archivtab WHERE objID=:obj;
>EXEC SQL AT :conn LOB DESCRIBE :blob GET LENGTH INTO :length;
>if (length == 0) return -1;
>*ptr=malloc((unsigned int)length);
>tmp=*ptr;
>
>do
>{
> amt=length>32000?32000:length;
> buffer.len=amt;
>
> EXEC SQL AT :conn LOB READ :amt FROM :blob AT :offset INTO :buffer;
>
> memmove(tmp,buffer.arr,amt);
> tmp+=32000;
> length-=32000;
> offset+=32000;
>} while (length>0);
>
>EXEC SQL AT :conn FREE :blob;
>
>
Received on Fri Jul 09 1999 - 17:02:43 CEST

Original text of this message