RE: [PHP] how to get time cost for MySQL query

2005-07-12 Thread yanghshiqi
Yes, mysql will cache your same query every time. So what you need is to just test the microtime before and after your query script. If you just want to know how about the efficiency about your sql script, you can use the mysql_command line and explain it. Otherwise, I think trying to catch the "qu

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Richard Lynch
Try doing an "explain $query" query. I *think* MySQL might cache the query/results enough that you'd get an accurate estimate... You could also turn MySQL Logging on. Or, rather crudely, time it in PHP: $query_start_time = microtime(); $result = mysql_query($query); $query_end_time = microtime(

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info... thanks "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Hi, Is there any MySQL lib function which can provide time cost for last >> query? >> > > Maybe... > > http://us2.php.net/manual/en/funct

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info... thanks "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Hi, Is there any MySQL lib function which can provide time cost for last >> query? >> > > Maybe... > > http://us2.php.net/manual/en/fun

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Philip Hallstrom
Hi, Is there any MySQL lib function which can provide time cost for last query? Maybe... http://us2.php.net/manual/en/function.mysql-info.php http://us2.php.net/manual/en/function.mysql-stat.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.