MySQL Forums
Forum List  »  Performance

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
Re: query to find gaps in sequential indexes causes CPU spikes
831
November 23, 2011 11:01PM


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.