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

Home -> Community -> Usenet -> c.d.o.server -> Re: FIRST_ROW USAGE

Re: FIRST_ROW USAGE

From: Pete Sharman <psharman_at_us.oracle.com>
Date: Fri, 11 Jun 1999 13:37:37 -0700
Message-ID: <37617391.6230CA01@us.oracle.com>


Mike

From the tuning manual:

The FIRST_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best response time (minimum resource usage to return first row).

This hint causes the optimizer to make these choices:

     If an index scan is available, the optimizer may choose it over a full table scan.

     If an index scan is available, the optimizer may choose a nested loops join over a sort-merge join whenever the associated table is the potential inner table of the nested loops.

     If an index scan is made available by an ORDER BY clause, the optimizer may choose it to avoid a sort operation.

Notice it's FIRST_ROWS, not FIRST_ROW as in your example. Normally, you would choose to use this in an online system, whereas ALL_ROWS might be used in a batch system.

HTH. Pete

yarch_at_hotmail.com wrote:

> Hi,
> I've been given code that looks like
> this
>
> SELECT /*+ FIRST_ROW */
> ...
> FROM
> WHERE
>
> what exactly does this do in order to improve efficiency?
> I'm familiar with /*+ CACHE */ Is it something similiar?
> Thanks,
> Mike Yarcheski
> yarch_at_hotmail.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

--

Regards

Pete


Received on Fri Jun 11 1999 - 15:37:37 CDT

Original text of this message

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