Re: COUNT(*) performance

2002-10-02 Thread david
Davide Copelli wrote: > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM log WHERE (field1 = ? and > field2= ? )|); > $sth->execute( $a1, $a2 ); > $total = $sth->fetchrow_array(); > > or > > my $sth = $dbh->prepare(qq|SELECT id FROM lo

RE: COUNT(*) performance

2002-10-02 Thread Bob Showalter
> -Original Message- > From: Davide Copelli [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 02, 2002 8:58 AM > To: [EMAIL PROTECTED] > Subject: COUNT(*) performance > > > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM l

Re: COUNT(*) performance

2002-10-02 Thread Jenda Krynicky
From: "Davide Copelli" <[EMAIL PROTECTED]> > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM log WHERE (field1 = ? > and field2= ? )|); $sth->execute( $a1, $a2 ); $total = > $sth->fetchrow_array(); > > or > > my $sth