MySQL Forums
Forum List  »  Newbie

Re: Faster SQL - newbie needs help
Posted by: Rick James
Date: August 17, 2010 08:49PM

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

1. EAV design is terrible on performance.

2. UUIDs are big, hence bad on performance.

3. JOINs often work much faster than subqueries.

4. FULLTEXT (if you are searching on words) works much faster than LIKE '%...'.

Options: ReplyQuote


Subject
Written By
Posted
Re: Faster SQL - newbie needs help
August 17, 2010 08:49PM


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.