From:                   "Davide Copelli" <[EMAIL PROTECTED]>
> On a Mysql database of 60000 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 log WHERE (field1 = ? and
> field2= ? )|); $sth->execute( $a1, $a2 ); $total = $sth->rows;
> 
> where "id" is a primary key field

It's always better to do as much as possible as near to the data as 
possible.

Besides ... if you really need to know ... why don't you benchmark 
it?

Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
                                        --- me


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to