MySQL Forums
Forum List  »  Performance

Re: MySQL not using indexes
Posted by: Darrell Esau
Date: February 24, 2011 06:57PM

Ah - I think I need to back up here.

My original assumption was that MySQL wasn't using the indexes at all, because there was no "Using index" in the "Extra" column of the EXPLAIN output. However, (assuming my understanding is correct), that's not true -- it is using the indexes, it just couldn't get all the data needed out of the indexes, so it had to actually perform the table lookup based on the index.. But it _is_ using the indexes.

I know I can't get all the data out of the index for this particular query -- there's just too much data that's needed .. so that's fine.

However ... if it indeed is using the indexes, I'm at a loss as to why this query is so slow. I pulled this query out of my slow queries log .. it was one of my naughtiest queries .. at times, it takes upwards of 120 seconds to complete.

Maybe my expectations are invalid? Maybe I've just got too much data in this table? The "territories_finished" table has around 19 million rows, the "territory_borders_finished" table has around 72 million rows. Is a well-indexed query on tables this size expected to run at around 1 - 2 minutes?

Options: ReplyQuote


Subject
Views
Written By
Posted
3618
February 23, 2011 01:31AM
1213
February 23, 2011 08:16AM
1083
February 23, 2011 09:58AM
1179
February 24, 2011 09:26AM
1211
February 24, 2011 12:25PM
1458
February 24, 2011 03:36PM
Re: MySQL not using indexes
1126
February 24, 2011 06:57PM
1560
February 24, 2011 08:49PM
1045
February 25, 2011 12:52AM
1034
February 25, 2011 07:44AM
929
February 25, 2011 11:40AM


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.