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: how to tune up this query?

Re: how to tune up this query?

From: Ethel Aardvark <bigjobbies_at_hotmail.com>
Date: 4 Feb 2003 01:09:04 -0800
Message-ID: <1a8fec49.0302040109.76fd37f0@posting.google.com>


I'd have to see the explain plan to be convinced.

Perhaps an alternative strategum of keeping things in order as tehy are inserted and modified by means of triggers. Of course, the real answer lies in the ration of writes : reads.

I have just noticed that the "order by stage" is completely redundant anyway, as the query specifies only one value for "stage"! (Probably a mis-type, I suppose).

Regards,

ETA. "Richard Foote" <richard.foote_at_bigpond.com> wrote in message news:<bt9_9.36755$jM5.93743_at_newsfeeds.bigpond.com>...
> "Ethel Aardvark" <bigjobbies_at_hotmail.com> wrote in message
> news:1a8fec49.0301300505.46e10f1b_at_posting.google.com...
> > Susan,
> > Without trying it, could this not be re-written as follows:
> >
> > SELECT id, name, priority FROM table_name
> > WHERE stage = 'start' and state = 1
> > AND rownum <= 1000
> > ORDER BY stage ASC
> >
> > Remember that rownun is treated differently from other fields and will
> > not be applied until AFTER the sort has taken place.
> >
>
> Hi Ethel,
>
> True, but the sort as a result is potentially going to be one big mamma.
>
> See my previous post why your code is less efficient than Susan's.
>
> Cheers
>
> Richard
Received on Tue Feb 04 2003 - 03:09:04 CST

Original text of this message

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