Re: count (1) and count (*)
From: Frank <fvanbortel_at_netscape.net>
Date: Fri, 31 Oct 2003 09:30:03 +0100
Message-ID: <bnt63t$elb$1_at_news2.tilbu1.nb.home.nl>
Date: Fri, 31 Oct 2003 09:30:03 +0100
Message-ID: <bnt63t$elb$1_at_news2.tilbu1.nb.home.nl>
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
>
> gelangov_at_hotmail.com (Geetha) wrote in message news:<4b40e20a.0310290724.13e86079_at_posting.google.com>...
>
>>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.
NO!
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 BortelReceived on Fri Oct 31 2003 - 09:30:03 CET