Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check MySQL performance?

i have mysql that is used on production server for php webshop application.

sometimes it works very slow. so, i will change indexes for several tables.

but before that, i have to make some kind of "snapshot" of current performances (several times per day). after that, i will change indexes, and create new "performance snapshot". then i will made some more changes in database, and made another "performance snapshot".

how can i make that "performance snapshot"? is it possible to use some kind of tool, or to ckeck some logs, or...?

if you can help me how to do that.

thank you in advance!

like image 674
user198003 Avatar asked Dec 06 '25 20:12

user198003


1 Answers

If you want to buy a commercial product, there is the MySQL Query Analyzer

Otherwise, you could use the SQL Profiler which is already included with MySQL.

The SQL Profiler is built into the database server and can be dynamically enabled/disabled via the MySQL client utility. To begin profiling one or more SQL queries, simply issue the following command:

mysql> set profiling=1;

Thereafter, you will see the duration of each of your queries as you run them.

like image 159
THE DOCTOR Avatar answered Dec 08 '25 08:12

THE DOCTOR