Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Difference between count(1) and count(*)
I've actually seen an "expert" optimizing the count() statement, by using
count(null) "since null means nothing and thus is the fastest" :)
But check this:
SQL> select count(*) from dual;
COUNT(*)
1
SQL> select count(null) from dual;
COUNT(NULL)
0
Tanel.
> > On Thu, 8 Jul 2004 11:27:28 +0530 oracle-l_at_freelists.org wrote:
> > > Can you let me know the difference between count(*) and count(1) ?
> >
> > count(1) is supposed to be more efficient and faster.
>
> Oh boy, here we go.
>
> --
> Jeremiah Wilton
> http://www.speakeasy.net/~jwilton
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Jul 08 2004 - 03:36:14 CDT