MySQL Forums
Forum List  »  Newbie

Re: Query performance on database with joins
Posted by: Rick James
Date: December 24, 2008 05:38PM

It will depend. If there are a lot of %drax% authors, the second one will be slower.

Further explanation (and thanks for using [ code ] )...

Note in the first explain:
* format is fully scanned (354 rows)
* module contributes about 1089 thingies FOR EACH FORMAT. -- It has now collected 354 * 1089 rows before getting around to filter on %drax%.

Your subquery went thru all 21K authors and found only 18. That made the rest fall in place without much further work.

You have a tough problem.
* %drax% requires a table scan -- slow, and gets slower as the table grows
* multi-table join
* ORDER BY...LIMIT can't easily be calculated from an index.

Options: ReplyQuote


Subject
Written By
Posted
Re: Query performance on database with joins
December 24, 2008 05:38PM


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.