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: Do I need "ORDER BY"

Re: Do I need "ORDER BY"

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 10 Sep 1999 16:46:17 +0100
Message-ID: <936979590.23983.0.nnrp-07.9e984b29@news.demon.co.uk>

If you are running rule-based, yes.
If you are running cost-based FIRST_ROWS, quite possibly.
If you are running cost-based ALL_ROW, probably not.

For cost-based optimisation it all depends on number of rows and packing of data according to that column etc.

BTW - if you are after a character value that is smaller than all those in the column, then chr(0) is probably the best bet.

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Mark Schenkel wrote in message <37D92475.437F671B_at_alpinesoftware.com>...
>Will the following two SQL Statements retrieve the same result sets if
>there is a index on MKEY?:
>
>SELECT * FROM MYTABLE WHERE MKEY >= ' '
>
>SELECT * FROM MYTABLE WHERE MKEY >= ' ' ORDER BY MKEY
>
>My thinking is that for the first statement the server will use the
>index because of the "WHERE" clause. It will then continue to use this
>index when it returns the records from the server.
Received on Fri Sep 10 1999 - 10:46:17 CDT

Original text of this message

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