MySQL Forums
Forum List  »  Optimizer & Parser

Re: Make optimized LEFT JOIN with GROUP BY
Posted by: Beat Vontobel
Date: May 03, 2006 09:11AM

Hi Jerry,

I suppose your query looks something like this:

SELECT recipe_id, MAX(picture_id) FROM recipes LEFT JOIN pictures USING (recipe_id) GROUP BY recipe_id

So did you try to add an index to your pictures table spanning _both_ rows, like so KEY (recipe_id, picture_id)? I think this should help, at least in fairly recent versions of MySQL.

Cheers,
Beat

Beat Vontobel
http://www.futhark.ch/mysql

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Make optimized LEFT JOIN with GROUP BY
5302
May 03, 2006 09:11AM


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.