RE: [PHP] Question on response time, SQL vs. PHP

From: Date: Mon, 31 Mar 2003 21:34:00 +0000
Subject: RE: [PHP] Question on response time, SQL vs. PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-141745@lists.php.net to get a copy of this message
It is faster to do a count(*) -----Original Message----- From: Liam Gibbs [mailto:liamgibbs@sympatico.ca] Sent: Monday, March 31, 2003 1:31 PM To: php list Subject: [PHP] Question on response time, SQL vs. PHP I'm trying to do a count(*) in SQL. Would it be faster to do a or b below? a: just do a simple query, and use mysql_num_rows() to return the row count; or b: do the count(*) and use mysql_fetch_row() to return the result. I guess it would have to do more with SQL response time (is it faster to grab the count and then the row, or all rows in question and then do a count in PHP).

« previous php.general (#141745) next »