OK So I have this list of products that are in the cart. I am trying to retrieve all the related items to the items in the cart without pulling any items that are in the cart.
I wrote this query and it pulls exactly what I want, but its taking like 8 seconds to run.
SELECT * FROM cart_product
WHERE product_id
IN(
SELECT product_related_related_id FROM `cart_product_related`
WHERE product_related_product_id
IN (5401,5402,4983,5004)
)
AND product_id
NOT IN(5401,5402,4983,5004)
Showing rows 0 - 2 (3 total, Query took 7.9240 sec)
Is there some way I can optimize this to make it run faster?
Thanks!