Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to tune up this query?
"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 Thu Jan 30 2003 - 08:27:34 CST