MySQL Forums
Forum List  »  Performance

Re: Query with Inner Join to small table suddenly takes FOREVER
Posted by: Rick James
Date: March 08, 2014 01:03PM

> inner join t_lob l on t.account = l.account
> and t.skill = l.skill

needs compound INDEX(account, skill) (or the opposite order)

> t.account = '12345678'
> and t.startdate between '2014-02-12' and '2014-02-28'

needs compound INDEX(account, startdate) (in that order)

Those two indexes cannot be combined into one.

When the query is slow, is the inner query slow? Or the whole query?

Please provide SHOW CREATE TABLE.

SHOW VARIABLES LIKE '%buffer%';

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query with Inner Join to small table suddenly takes FOREVER
1231
March 08, 2014 01:03PM


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.