Cool .... but how about if you put a where clause to your select??

SQL> select count(1) from product where productid >3;

  COUNT(1)
----------
         7

Would count(*) show the same performance as count(1)???

Siomara


>From: "Eric Fitzgerald" <[EMAIL PROTECTED]>
>To: "Siomara Pantarotto" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>Subject: Re: count(*) on different tables
>Date: Mon, 21 May 2001 13:11:38 -0700
>
>Actually, as far as performance goes, it depends on table types.  Most of
>the MySQL table handlers keep an internal count of record numbers.  Thus, a
>select count(*) from table; is as fast as it gets.
>
>----- Original Message -----
>From: "Siomara Pantarotto" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, May 21, 2001 12:26 PM
>Subject: Re: count(*) on different tables
>
>
> > Well ...
> >
> > I don't know enough about mysql but it must allow you somehow to specify
>the
> > column by number as in Oracle and other DBs
> >
> > SQL> select count(*) from product;
> >
> >   COUNT(*)
> > ----------
> >         10
> >
> > SQL> select count(1) from product;
> >
> >   COUNT(1)
> > ----------
> >         10
> >
> > Once you just want to count the rows the performance of your select will
>be
> > much better if you specify a column rather than *.
> >
> > Siomara
> >
> >
> > >From: "Ansgar Becker" <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Subject: count(*) on different tables
> > >Date: Mon, 21 May 2001 20:18:35 +0200
> > >
> > >Hi,
> > >
> > >is it possible to get *one* quick result with the rowcount of each 
>table
>in
> > >one database, without knowing the column-names?
> > >
> > >this does *not* work:
> > >  select count(t1.*), count(t2.*)
> > >    from table1 t1, table2 t2
> > >
> > >Manual doesn't say anything about that.
> > >
> > >Greetings,
> > >Ansgar Becker
> > >
> > >
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > >To request this thread, e-mail <[EMAIL PROTECTED]>
> > >To unsubscribe, e-mail
> > ><[EMAIL PROTECTED]>
> > >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> >
> > 
>_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at 
>http://www.hotmail.com.
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
> >
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to