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 23, 2011 11:01PM

> I've used EXPLAIN and it is using my index to do a range look up and estimates a single row for the dependant subquery.
May I please see the EXPLAIN?

> could have as much as million rows where column1 = 10.
So it might have to read most of that million? That takes CPU time (assuming everything is cached, and you don't pound on the disk).

> cpu can spike to 50+%
Your machine has 2 cores?

> finding gaps
What do you mean? Given 1,2,6,7,9,10,11,12,15; you want to say there is a gap from 3-5 and 8-8 and 13-14 ? If so, I think that can be done in one or two passes, no "iterations". The output would be:
3 5
8 8
13 14

Options: ReplyQuote


Subject Views Written By Posted
query to find gaps in sequential indexes causes CPU spikes 1408 Chris Nevin 11/22/2011 12:50PM
Re: query to find gaps in sequential indexes causes CPU spikes 637 Rick James 11/23/2011 11:01PM
Re: query to find gaps in sequential indexes causes CPU spikes 704 Chris Nevin 11/25/2011 05:19PM
Re: query to find gaps in sequential indexes causes CPU spikes 641 Rick James 11/26/2011 06:02PM
Re: query to find gaps in sequential indexes causes CPU spikes 823 Chris Nevin 11/28/2011 04:58PM
Re: query to find gaps in sequential indexes causes CPU spikes 730 Rick James 11/29/2011 09:23PM
Re: query to find gaps in sequential indexes causes CPU spikes 478 Chris Nevin 11/30/2011 10:41AM
Re: query to find gaps in sequential indexes causes CPU spikes 740 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.