Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Difference between count(1) and count(*)
Stemming off topic...both work in sql server for me.
> On July 8, 2004 12:20 am, Jared Still wrote:
> > On Wed, 2004-07-07 at 23:28, Lyndon Tiu wrote:
> > > On Thu, 8 Jul 2004 11:27:28 +0530 oracle-l_at_freelists.org wrote:
> > > > Dear All,
> > > > Can you let me know the difference between count(*) and count(1) ?
> > >
> > > count(1) is supposed to be more efficient and faster.
> >
> > Notice the qualifier: 'supposed to be'
> >
> > Was the claim backed up by evidence?
> >
>
> No and it seems that this is an oracle only feature. I tried it (count(1))
on
> sql server and it does not work. But it works on postgresql though.
>
> I remember reading this from somewhere, whether it is from an official
oracle
> doc or just some db dude on the internet I do not remember. But it seems
that
> other oracle db dudes I've met say the same thing, that count(1) is more
> efficient. Maybe it's a lie that's been propagated acrosshundreds of
> generations?
>
> I recall seeing count(1) being faster but then I did not really measure
with
> anything more than counting sheep in my head.
>
> We should experiment and get an empirical result. I will see if I find
some
> time to research this on oracle official docs myself.
>
> --
> Lyndon Tiu
> ----------------------------------------------------------------
> 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 - 22:36:04 CDT