MySQL Forums
Forum List  »  Performance

Re: query to find gaps in sequential indexes causes CPU spikes
Posted by: Chris Nevin
Date: November 25, 2011 05:19PM

Explain shows two rows:

select_type type key key_len ref rows extra
primary range column1_column0 8 NULL 1250268 Using where; Using index
dependant subquery ref column1_column0 8 const,func 1 Using where; Using index

The server is an AWS x-large RDS instance spec'd as having 4 virtual cores and 15 GB of RAM.

I'm actually trying to find the start and ends of a block - so given your numbers my output would look like:

1 2
6 7
9 12
15 15

I realize there are other ways to write the queries to cut down on the number of iterations. But so far through my experimentation, I haven't found anything yet that's easier on the cpu. Any ideas on how to optimize (especially for mysql since I've seen some major differences in the performance between mysql and sql server) would be greatly appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: query to find gaps in sequential indexes causes CPU spikes
1214
November 25, 2011 05:19PM


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.