PHP/MySQL query time
am 02.11.2005 00:57:11 von j80k-vpfc
PHP/MySQL query - time taken.
MySQL reports how long each query takes, is this available to PHP,
because if it is, it's not documented in the book I have, or I don't
know what I'm looking for.
I would like to play with some LIKE queries, but would like to know how
much they slow the query down by.
If you go to the command line client.
From a dos box.
login to MySQL,
'Use databasename'
'SELECT * from tablename'
it shows the tabulated results and underneath it shows...
xxx rows in set <0.yy sec>
'0.yy sec' is the value I'm after.
mtia,
- Steve
Re: PHP/MySQL query time
am 02.11.2005 08:28:10 von Shion
Steve wrote:
> PHP/MySQL query - time taken.
> MySQL reports how long each query takes, is this available to PHP,
> because if it is, it's not documented in the book I have, or I don't
> know what I'm looking for.
>
> I would like to play with some LIKE queries, but would like to know how
> much they slow the query down by.
>
>
> If you go to the command line client.
>
> From a dos box.
>
> login to MySQL,
>
> 'Use databasename'
>
> 'SELECT * from tablename'
>
> it shows the tabulated results and underneath it shows...
>
> xxx rows in set <0.yy sec>
>
> '0.yy sec' is the value I'm after.
Take a look at mysql_info, should be able to give you the time as it can get
other data.
//Aho
Re: PHP/MySQL query time
am 02.11.2005 10:02:12 von j80k-vpfc
In article <3sr7tgFpded6U1@individual.net>, user@example.net (J.O. Aho)
wrote:
> *Subject:* Re: PHP/MySQL query time
> *From:* "J.O. Aho"
> *Date:* Wed, 02 Nov 2005 08:28:10 +0100
>
> Steve wrote:
> > PHP/MySQL query - time taken.
> > MySQL reports how long each query takes, is this available to PHP,
> > because if it is, it's not documented in the book I have, or I
> > don't know what I'm looking for.
> >
> > I would like to play with some LIKE queries, but would like to know
> > how much they slow the query down by.
> >
> >
> > If you go to the command line client.
> >
> > From a dos box.
> >
> > login to MySQL,
> >
> > 'Use databasename'
> >
> > 'SELECT * from tablename'
> >
> > it shows the tabulated results and underneath it shows...
> >
> > xxx rows in set <0.yy sec>
> >
> > '0.yy sec' is the value I'm after.
>
> Take a look at mysql_info, should be able to give you the time as it
> can get
> other data.
>
> //Aho
>
Seemingly not, it returns a NULL for a SELECT.
http://dev.mysql.com/doc/refman/5.0/en/mysql-info.html as I read it
states that it's for INSERT, LOAD, ALTER and UPDATE's. Which certainly
goes along with what I'm seeing.
- Steve
Re: PHP/MySQL query time
am 02.11.2005 10:27:20 von Shion
Steve wrote:
> Seemingly not, it returns a NULL for a SELECT.
> http://dev.mysql.com/doc/refman/5.0/en/mysql-info.html as I read it
> states that it's for INSERT, LOAD, ALTER and UPDATE's. Which certainly
> goes along with what I'm seeing.
Okey, then you can do a dirty trick and take the unix time before and after
the query and thats the time the query took.
//Aho
Re: PHP/MySQL query time
am 02.11.2005 12:32:03 von Steve
> PHP/MySQL query - time taken.
> MySQL reports how long each query takes, is this available to PHP,
> because if it is, it's not documented in the book I have, or I don't
> know what I'm looking for.
That's a function of the command-line MySQL client, not the MySQL
server. You'll need to write your own function.
---
Steve
Re: PHP/MySQL query time
am 02.11.2005 12:48:14 von j80k-vpfc
In article <3srestFpf61rU1@individual.net>, user@example.net (J.O. Aho)
wrote:
> *Subject:* Re: PHP/MySQL query time
> *From:* "J.O. Aho"
> *Date:* Wed, 02 Nov 2005 10:27:20 +0100
>
> Steve wrote:
>
> > Seemingly not, it returns a NULL for a SELECT.
> > http://dev.mysql.com/doc/refman/5.0/en/mysql-info.html as I read it
> > states that it's for INSERT, LOAD, ALTER and UPDATE's. Which
> > certainly goes along with what I'm seeing.
>
> Okey, then you can do a dirty trick and take the unix time before and
> after
> the query and thats the time the query took.
>
> //Aho
>
yeah, I think that's the direction I'm going in. Thanks :-)
- Steve