MySQL Forums
Forum List  »  Newbie

Re: Faster SQL - newbie needs help
Posted by: Phillip Ward
Date: August 18, 2010 06:40AM

PMFJI, but
SELECT  a.*
FROM  jos_zoo_item as a
JOIN 
   (  SELECT  b.item_id
      FROM  jos_zoo_search_index as b
      WHERE  b.element_id = '688d9a68-5ce2-4c53-b226-a053499ef634'
      AND  b.value LIKE '%Stockholms län%') as b 
  ON a.id = b.item_id

Are the braces around the sub-select(?) necessary?

Do they have any performance impact (positive or negative)?

Could the same end be achieved by ...
SELECT  a.*
FROM  jos_zoo_item as a
LEFT JOIN jos_zoo_search_index as b 
  ON ( a.id = b.item_id 
       and b.element_id = '688d9a68-5ce2-4c53-b226-a053499ef634' 
       and b.value like '%Stockholms län%' 
     )
... or have I missed something?

I'm still trying to get my head around some of the more "esoteric" bits of MySQL's syntax.

Regards,
Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Faster SQL - newbie needs help
August 18, 2010 06: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.