Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Do I need "ORDER BY"
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
![]() |
![]() |