views:

52

answers:

2

First of all, I am using PhpMyAdmin, is this okay or not? Because when I have cache disabled, and do two queries after eachother, the second query always is faster, so I am thinking maybe there is an internal cache on PhpMyAdmin?

Secondly, is there any way to get the time of how long a query takes, into php, and echo it onto the browser? (so I can use php instead of phpMyAdmin)

Thirdly, SHOW STATUS LIKE '%qcache%' gives me this:

Qcache_free_blocks       1
Qcache_free_memory       25154096
Qcache_hits              0
Qcache_inserts       2
Qcache_lowmem_prunes     0
Qcache_not_cached        62
Qcache_queries_in_cache  2
Qcache_total_blocks      6

How come Qcache_not_cached grows by a number of 5 or 10 for every query I make? Shouldn't there only be 1 increase per query?

Also, when I enabled the cache, and did a query, the Qcache_queries_in_cache got increased by 2... I thought it would be increased by 1 per every query, explain someone?

THEN, when I did another query the same as the one I cached, there was no performance gain at all, the query took as long as without the cache enabled...

Any help here please except for referring to the manual (I have read it already).

Thanks

UPDATE

Here is a typical query I make:

   SELECT * FROM `langlinks` WHERE ll_title='Africa'
A: 

PhpMyAdmin do query and update status from the mysql server, so you won't see it increment by one in phpmyadmin

Dennis Cheung
+1  A: 

First of all, I am using PhpMyAdmin, is this okay or not?

I suppose it's better than nothing -- and more user-friendly than a command-line client ; but a thing I don't like with phpMyAdmin is that it sends queries you didn't write.

I've already seen phpMyAdmin send some queries that were "hurting" a server, while the one that had been written by the user was OK, for instance (I don't have the exact example in mind).

Generally speaking, though, I'd say it's "ok" as long as you accept that more requests will be sent : phpMyAdmin displays lots of informations (like the list of databases, tables, and so on), and has to get those informations from somewehre !

Shouldn't there only be 1 increase per query?

If you really want to see the impact of your query and no other, you'd probably better use the command-line mysql client, instead of phpMyAdmin : that graphical tool has to send queries to get the informations it displays.

The question, actually, is : do you prefer a user-friendly tool ? Or do you want to monitor only what your query actually does ?

In most cases, the answer is "user-friendly tool" -- and that's why phpMyAdmin has so much success ;-)

Pascal MARTIN