How to check which sql query takes longer? (MYSQL) I use a dedicated Linux server and the website consumes 1 GB of RAM, the company says due to SQL queries (MYSQL). Can someone tell me how to check which sql queries take longer and use more resources?
You can use the Mysql Slow Query Log .
Mysql provides the EXPLAIN keyword to display the query execution plan; just put "EXPLAIN" in front of your query, and Mysql will display the execution plan for that query.
http://dev.mysql.com/doc/refman/5.0/en/explain.html
EXPLAIN, , . MySQL , .
MySQL, , MySQL , MySQL. , MySQL, my.cnf. MySQL - . , . .