EXPLAIN gives you the time (through processor?) of the clauses translated
into WHERE (JOIN, GROUP, etc)

if you use 1000 billions of functions in your query, the real time of that
query will be somewhat slower, but not for EXPLAIN.

microtime() is in php, so it gives you the time of when he called the
module, when he received and gave you back the answer.

none of them is precise for the purpose of printing on web. Bad idea.
But for the database design I still prefer EXPLAIN since it is for where's,
where YOU are the one to play with INDEXes and KEYs.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Anuradha Ratnaweera [mailto:[EMAIL PROTECTED]]On Behalf Of Anuradha
Ratnaweera
Sent: Wednesday, May 02, 2001 2:06 PM
To: Maxim Maletsky
Cc: 'James, Yz'; [EMAIL PROTECTED]
Subject: RE: [PHP] SQL Query time?



I wonder if using microtime() gives _actual_ time spent for the query
while explain gives _processor_ time.

Anuradha

On Thu, 26 Apr 2001, Maxim Maletsky wrote:

> what about microtime() ?
>
> you can do it your self:
>
> $start = microtime();
> mysql_query()...
> $stop = microtime();
>
> $token = round($stop-$start, 3);
> echo "Query took $token seconds";
>
> I mean this is not as precise as SQL would do itself, but will work
> approximately.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -----Original Message-----
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 5:17 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] SQL Query time?
>
>
> Hi all,
>
> I have seen a few pages that echo the time it's taken to execute an SQL
> query, like "The results in the database were returned in 0.3 seconds."
> Anyone know if there's a built in function to display this, and if there
is,
> what it is?  My more-than-useless-ISP seems to have taken an aversion to
> allowing me to surf tonight without disconnecting me.
>
> Thanks.
> James.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to