Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI prefetch: which way is better?

Re: OCI prefetch: which way is better?

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 10 Dec 2002 11:08:10 GMT
Message-ID: <uWjJ9.7125$hw3.2192@sccrnsc04>


3. The concept of prefetch is to get more than 1 row in a packet. There is a limit as to the number of rows that can fit into a packet. If you want to get real fancy you can look at the "width" of the data (approx) and vary things that way. But setting it too high (eg 100,000) can cause problems. (You are allocating memory for that many rows on the client and that might actually slow things down. Swap , swap , swap) Instead try 50 to 100 or even 200 rows. Unlikely that you are going to fit 200 rows into a packet.

Don't count first. That will dramatically slow the system down. (causing the server to do the work twice)
Jim

"music4" <cli4_at_lucent.com> wrote in message news:at47i9$evp_at_netnews.proxy.lucent.com...
> Greetings,
>
> When we do a select operation, we can set OCI_ATTR_PREFETCH_ROWS to
minimize
> server round trips. There are two ways to implement that as following:
>
> 1. Do a "select count(*) where ..." first to get actual row numbers, and
use
> this number to set prefetch rows.
>
> 2. Just use very big number for example 100000 (sometime it will be still
> less then actual row number) to set prefetch row.
>
> Which way is better? I am wondering your idea.
>
> Thanks in advance!
> Evan
>
>
>
Received on Tue Dec 10 2002 - 05:08:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US