Re: Optimize subquery, replace IN() with JOIN
Posted by:
Rick James
Date: November 17, 2016 08:11PM
See if the comes closer to working:
SELECT a.id, a.title, a.alias
FROM content AS a
WHERE a.id =1842
AND EXISTS
(
SELECT *
FROM category_content_se
WHERE content_id = a.id
AND content_typ = 'actual'
)
ORDER BY a.date_add DESC
LIMIT 10;
Indexes:
content: INDEX(id, date) -- in this order
category_content_se: INDEX(content_id, content_typ) -- in either order
Subject
Views
Written By
Posted
2421
November 15, 2016 02:37PM
986
November 15, 2016 03:34PM
1124
November 15, 2016 04:25PM
Re: Optimize subquery, replace IN() with JOIN
969
November 17, 2016 08:11PM
938
November 22, 2016 02:44PM
953
November 16, 2016 04:03AM
980
November 16, 2016 12:51PM
1087
November 16, 2016 03:22PM
932
November 16, 2016 04:44PM
734
December 27, 2016 05:32AM
843
November 16, 2016 01:50AM
890
November 16, 2016 04:01AM
1050
November 16, 2016 06:23AM
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.