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

Re: how to tune up this query?

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Tue, 4 Feb 2003 23:08:00 +1000
Message-ID: <qMN%9.40325$jM5.102716@newsfeeds.bigpond.com>


Hi Ethel

See Niall's earlier posts regarding differences between the two.

The SORT (ORDER BY STOPKEY) operation tells us that an efficient top-n sort was performed.

Cheers

Richard
"Ethel Aardvark" <bigjobbies_at_hotmail.com> wrote in message news:1a8fec49.0302040109.76fd37f0_at_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 - 07:08:00 CST

Original text of this message

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