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: Are the two SQLs equivalent?

Re: Are the two SQLs equivalent?

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Wed, 08 Jun 2005 20:30:39 +0200
Message-ID: <d87d70$h35$1@news5.zwoll1.ov.home.nl>


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.
>
> --
> Bob Hairgrove
> NoSpamPlease_at_Home.com

Same myth source as select count(1) is faster than select count(*), I presume. Recommended by whom? Backed by what proof?

-- 
Regards,
Frank van Bortel
Received on Wed Jun 08 2005 - 13:30:39 CDT

Original text of this message

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