Skip navigation links

MySQL Forums :: Performance :: query to find gaps in sequential indexes causes CPU spikes


Advanced Search

Re: query to find gaps in sequential indexes causes CPU spikes
Posted by: Rick James ()
Date: November 29, 2011 09:23PM

> thread_cache_size could be increased to maybe 20, it's now 0.
Yes, non-zero will improve how fast a new connection can get started.

> uptime is 879166 and the opened_files is 13533
So, you are not opening files very fast. No need to change table_open_cache.

> set the table_open_cache (currently 400) to # of concurrent connection * max # joins in any query
A pessimistic formula, especially since
> no other connections going on

> Is there an optimum size for a buffer pool?
70% of available RAM, which is about what you have on your 34GB box (but not for 15GB):
> innodb_buffer_pool_size;27525120000

> max_connections is currently 2500 to handle periods of peak load
If thousands of connections are trying to do work, they will stumble over each other, and none of them will be efficient.

> Are the issues you're referring to, query optimization and/or performance tuning?
Mostly query optimization, so that each connection gets finished with its task(s) faster.

> avg row length 3065
Sounds like you have some bulky columns in the table. How many columns? Are some of them BLOB or TEXT? To you access all the columns all the time? Or can we split the table "vertically"? That is, move some of the bulky columns off into another table, so the lengthy queries are not stumbling over the unnecessary columns.

I would like to see SHOW CREATE TABLE CustomerData.

Did you try the NOT EXISTS version?

How many rows have column1 = 10 ?
The explain suggest that there may be 1250268.
If so, that is a lot of data to scan over. Are all the connections doing that same query? Or similar queries? How frequently does the data change? Can the results be cached for some period of time -- that is, would that be "good enough"?

Does part of the table stay constant? That is, are all the new rows added at the "end" of the table? I am fishing for whether the information can be pre-calculated and saved, with updates periodically as the data comes in.

Options: ReplyQuote


Subject Views Written By Posted
query to find gaps in sequential indexes causes CPU spikes 1400 Chris Nevin 11/22/2011 12:50PM
Re: query to find gaps in sequential indexes causes CPU spikes 634 Rick James 11/23/2011 11:01PM
Re: query to find gaps in sequential indexes causes CPU spikes 701 Chris Nevin 11/25/2011 05:19PM
Re: query to find gaps in sequential indexes causes CPU spikes 635 Rick James 11/26/2011 06:02PM
Re: query to find gaps in sequential indexes causes CPU spikes 814 Chris Nevin 11/28/2011 04:58PM
Re: query to find gaps in sequential indexes causes CPU spikes 725 Rick James 11/29/2011 09:23PM
Re: query to find gaps in sequential indexes causes CPU spikes 475 Chris Nevin 11/30/2011 10:41AM
Re: query to find gaps in sequential indexes causes CPU spikes 733 Rick James 12/01/2011 10:13AM


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.