Re: Difference between count(1) and count(*)

  • From: "Darrell Landrum" <darrell@xxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 8 Jul 2004 22:39:04 -0500

Stemming off topic...both work in sql server for me.


----- Original Message ----- 
From: "Lyndon Tiu" <ltiu@xxxxxxxxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Thursday, July 08, 2004 9:19 AM
Subject: Re: Difference between count(1) and count(*)


> 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@xxxxxxxxxxxxx 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@xxxxxxxxxxxxx
> put 'unsubscribe' in the subject line.
> --
> Archives are at //www.freelists.org/archives/oracle-l/
> FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: