Re: count (1) and count (*)

From: Frank <>
Date: Fri, 31 Oct 2003 09:30:03 +0100
Message-ID: <bnt63t$elb$>

Daniel Roy wrote:
> I read somewhere (asktom?) that "select count(1) from table" is
> internally rewritten as "select count(*) from (select 1 from table)",
> and therefore just adds some overhead.
> Daniel
> (Geetha) wrote in message news:<>...

>>I searched in the Oracle documents what count (1) meant and I could
>>not find an answer.  Can some one explain what Oracle does internally
>>when use count (1) VS count (*).  Thank you very much in advance! We
>>use Oracle 9i.

Actually Tom wrote:
"Prove it, give me that test case. You are wrong. COUNT(*) and COUNT(1) are the *same* -- the same -- the same -- no different, the same.
count(1) is internally optimized to count(*) "

And he posted the explain plans for count(*) and count(1).

Regards, Frank van Bortel
Received on Fri Oct 31 2003 - 09:30:03 CET

Original text of this message