The Oracle documentation mentions that for optimum performance, LOB data should 
be read/written in multiples of the LOB's chunk size.  
(http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28393/adlob_performance.htm#i1007089)
 

After reading that, I realized DBD::Oracle does not support a direct way to get 
that chunk size. It can be gotten by calling DBMS_LOB.GETCHUNKSIZE in an 
anonymous block or SQL statement, but that adds overhead. As an exercise I 
added a ora_lob_chunk_size function which calls OCILobGetLength. A patch for 
adding that function is attached. 

I think it would make a great addition to DBD::Oracle. No more  "my $chunk_size 
= 4096; # Arbitrary chunk size" or "$lump ||= 4096; # use benchmarks to get 
best value for you". And using it adds portability to your code, since 
apparently the default optimal chunk size has changed between 10g and 11g due 
to the introduction of SecureFile LOBs. 

Either way, I had fun doing this :) 


-- 
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com

Attachment: oci_lob_chunk_size.patch.gz
Description: GNU Zip compressed data

Reply via email to