Re: Why are no indexes used in this case?
Why the love affair with IN( SELECT ... ) !? It's much slower than JOIN in many versions of MySQL.
Everything in your query except the odd HAVING clause is covered by ...
SELECT *
FROM items i
JOIN items_tags it ON i.id = it.item_id
JOIN tags t ON it.tag_id = t.id AND t.name ='flowvis'
WHERE type = 'photo';
What's the EXPLAIN result for that?
I'm not clear on the purpose of ...
GROUP BY i.id
HAVING COUNT( DISTINCT it.tag_id ) =1
Subject
Written By
Posted
February 03, 2013 06:38AM
Re: Why are no indexes used in this case?
February 03, 2013 10:27AM
February 03, 2013 11:27AM
February 03, 2013 01:16PM
February 03, 2013 03:35PM
February 03, 2013 04:04PM
February 03, 2013 03:59PM
February 04, 2013 03:01PM
February 04, 2013 09:11PM
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.