Hi all,

a very general explanation how it works (leaving the gory details out).

- Fetching a LONG returns something called 'descriptor'.
- The first bytes that fit into the packet are directly retrieved
  in the same packet.
- For follow-up bytes the driver sends subsequent 'GETVAL' commands using the
  'descriptor', here retrieving (rawly) up to the packet size bytes of the LONG,
  or the size specified in that command.
- This behaviour is not configurable (always the first bytes of the first LONGs 
  are directly retrieved).

If you have very small LONGs, there will no other packets being sent. The only time
where this might be not so performant is when the packet size is large, and you are
not really interested in the LONG itself. 

So, for JDBC what happens is

- If you read a LONG with a getBytes method, obviously all bytes have to retrieved.

- If you use Blobs, or streams, the bytes are block-wise fetched on demand.

The only thing that is not configurable is the size of these blocks that are 
fetched on demand, but there is not a performance increase when you fetch this
byte-wise instead of in blocks of e.g. 32K, so this would be rather useless.

Regards
Alexander Schr�der
SAP Labs Berlin

> -----Original Message-----
> From: Sven K�hler [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 05, 2003 11:17 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Retrieving LONG values with JDBC
> 
> 
> >> Are fields containing LONG values prefetched, or only 
> transferred when
> >> accessed?
> > 
> > I think, that they are only transferred when accessed (or 
> if the length 
> > of the content is below a certain value).
> 
> I found out, that Perl's DBI-Objects have a property to 
> specifiy the max 
>   length of longs/blobs that are fetched automatically.
> 
> Is there such an Optimization in SAPDB's JDBC driver too?
> I didn't find an Option whichin the JDBC-API but it would be 
> fine, that 
> LONG columns are fetched automatically if their length is below a 
> certain value. An extra query for each long-column rises the latency 
> with which i get my data.
> I assume, that usually the whole row is transmitted without the 
> LONG/BLOB columns.
> 
> Another thing would be, if the protocol that JDBC uses to 
> talk to SAPDB 
> includes such a feature at the moment.
> 
> 
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to