You may need to check out the configuration of InnoDB.
You can start by running
SHOW VARIABLES LIKE 'have_innodb';
SHOW ENGINES;
These will indicate whether or not InnoDB is running properly.
If InnoDB is disabled, it is more than likely that the log files need to be recreated.
As long as you keep ibdata, delete ib_logfile0, delete ib_logfile1, and set innodb_log_file_size to 170M in my.ini, you should be able to start mysql and have mysql rebuild new ib_logfile0 and ib_logfile0 to 170M each as suggested by the article you mentioned in the chat room.
Before you try to change the configuration file, the first thing to check is index use. This part:
JOINS
Current join_buffer_size = 4.00 M
You have had 1117666 queries where a join could not use an index properly
You have had 207168 joins without keys that check for key usage after each row
suggests that many queries cannot use indexes, probably because there are no indexes to use.
Ask for the slow query log, check which queries are slow and check/test if indexes can be added to improve performance.
A general advice is first, to have indexes on all columns that are used in Joins and second, indexes on columns that are used in WHERE
, GROUP BY
and ORDER BY
clauses. But for this, you may need compound indexes and of course you can't create an index for every column combination. That would take too much space and would make Insert, Delete and Update statements much slower. So, you'll have to check what are the most common queries and optimize those first.
There are some tools/services that can help you identify better and faster where the bottlenecks are. One such tool is Percona Toolkit (also known as mk-query-digest, from Maatkit).
A slow query that needs 10 seconds to complete is not good. But it doesn't really affect performance if you are executing it once per hour. A query that needs 60ms can be really bad if it is a simple UPDATE
and is executed several times per second. These tools can help you identify those because you can analyze the logs and find total running time, number of times a query has been run and various other figures.
For your example query:
SELECT menu_links.link_path AS link_path
, menu_links.mlid AS mlid
, menu_links.router_path AS router_path
, menu_links.updated AS updated
FROM
dr_menu_links menu_links
WHERE ( (updated = '1')
OR ( (router_path NOT IN ( 'rss.xml' , 'node' , 'checkout'
, 'import' , 'image_captcha', 'my-favourites'
, 'my-orders', 'print' , 'search'
) )
AND (external = '0')
AND (customized = '1')
)
)
possible good indexes are an index on (updated)
and one on (external, customized, router_path)
Best Answer
I answered a question like this in another StackExchange site but only from the MySQL point of view
Please follow all links in this answer. Thank You !!!