MySQL Forums
Forum List  »  Newbie

Re: Very slow query, and, and, and...
Posted by: Rick James
Date: January 06, 2015 02:16PM

Yes, it could be caching. Try it with SQL_NO_CACHE just after "SELECT".

Or it could really be optimizer_search_depth. When there are a lot of JOINs, and all of them have the same "cost", the optimizer fails to do any pruning of the cost tree. This leads to searching and searching for the best order to do the JOINs in. But, in fact, any order will be as good as any other. optimizer_search_depth set to a low value tells the optimizer to quit quickly.

Also, see how long EXPLAIN SELECT ... takes. That does the optimization without performing the query.

Options: ReplyQuote


Subject
Written By
Posted
Re: Very slow query, and, and, and...
January 06, 2015 02:16PM


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.