MySQL Forums :: Newbie :: Faster SQL - newbie needs help


Advanced Search

Faster SQL - newbie needs help
Posted by: Morgan Gustafsson ()
Date: August 17, 2010 11:43AM

Hi,

I'm a newbie at SQL and hence need your help optimizing the following query.

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
JOIN(SELECT c.item_id FROM jos_zoo_search_index as c WHERE c.element_id = 'b018bdde-dc6e-401a-9619-7c0edfb490a7' AND c.value LIKE '%Data och IT%') as c ON a.id = c.item_id
JOIN(SELECT d.item_id FROM jos_zoo_search_index as d WHERE d.value LIKE '%Britny%') as d ON a.id = d.item_id

As you see I want some results from jos_zoo_item but only items which have some values in jos_zoo_search_index.

Any tips in how I can optimize this query would be very much appreciated.

Regards

Morgan

Options: ReplyQuote


Subject Written By Posted
Faster SQL - newbie needs help Morgan Gustafsson 08/17/2010 11:43AM
Re: Faster SQL - newbie needs help Guelphdad Lake 08/17/2010 11:46AM
Re: Faster SQL - newbie needs help Morgan Gustafsson 08/17/2010 12:08PM
Re: Faster SQL - newbie needs help laptop alias 08/17/2010 12:57PM
Re: Faster SQL - newbie needs help Rick James 08/17/2010 08:49PM
Re: Faster SQL - newbie needs help Morgan Gustafsson 08/18/2010 01:50AM
Re: Faster SQL - newbie needs help Phillip Ward 08/18/2010 06:40AM
Re: Faster SQL - newbie needs help Peter Brawley 08/18/2010 08:51AM
Re: Faster SQL - newbie needs help laptop alias 08/18/2010 09:02AM
Re: Faster SQL - newbie needs help Peter Brawley 08/18/2010 09:20AM
Re: Faster SQL - newbie needs help Phillip Ward 08/18/2010 10:05AM
Re: Faster SQL - newbie needs help Peter Brawley 08/18/2010 11:04AM
Re: Faster SQL - newbie needs help Rick James 08/18/2010 09:10PM
Re: Faster SQL - newbie needs help Phillip Ward 08/19/2010 03:30AM
Re: Faster SQL - newbie needs help Peter Brawley 08/19/2010 09:54AM


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.