Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Are the two SQLs equivalent?
Bob Hairgrove wrote:
>
> On Tue, 07 Jun 2005 19:53:01 GMT, Lee Fesperman
> <firstsql_at_ix.netcom.com> wrote:
>
> >Lastly, when using EXISTS the preferred form for the SELECT clause is 'SELECT *'.
> >Unless the optimizer is crazy it should make no difference and is clearer.
>
> In Oracle versions 8 or lower, 'SELECT 1 ...' was also recommended ...
> apparently, the server allocated memory for "*" columns or some such
> nonsense, requiring it to query the table definition, whereas with
> "SELECT 1" (or some other constant such as 'A') the engine didn't need
> to touch the table at all.
Oh well ... those 'crazy' optimizers ;^) Of course, the other parts of the query would also normally require accessing table definition to some degree.
Thanks for sharing.
-- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)Received on Tue Jun 07 2005 - 17:30:36 CDT
![]() |
![]() |