MySQL Forums
Forum List  »  Optimizer & Parser

Re: CPU usage 99% - and query very slow - help
Posted by: Rick James
Date: August 04, 2012 01:36PM

High CPU --> need to find worst query/queries --> add index and/or redesign query

You have the slow log; find the worst

To assist in analyzing slow SELECTs, please provide
* SHOW CREATE TABLE tbl\G -- engine, indexes
* SHOW TABLE STATUS LIKE 'tbl'\G -- sizes
* EXPLAIN SELECT ...\G -- clues of inefficiencies
* SHOW VARIABLES LIKE '%buffer%'; -- cache size
and surround them with [ code ] and [ / code ]
How much RAM do you have?

> all tables have indexes
Need the details.

> and are optimizaed every 3 days.
Usually a waste to do it that often. Less than 1% of tables need periodic OPTIMIZE. Monthly is probably often enough. (Again, need details to comment further.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: CPU usage 99% - and query very slow - help
1975
August 04, 2012 01:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.