MySQL Forums
Forum List  »  Newbie

Re: Query does not use index
Posted by: Peter Brawley
Date: February 04, 2022 11:03AM

Quote

when I rewrite query as

select MP.product_id, MP.style_id, MP.colorway_no, MP.design_id, MP.row_status, ch.colorway_id, ch.colorway_no
, GROUP_CONCAT( cm.col_name ORDER BY cw.col_no ASC SEPARATOR '/' ) colorway_desc
from mas_product MP
join colorway_h ch on ch.colorway_no = MP.colorway_no
JOIN colorway_det cw ON ch.colorway_id = cw.colorway_h_id
JOIN mas_color cm ON cw.col_id = cm.col_id
WHERE MP.product_id IN ('15298','15300','15296','15514')
GROUP BY MP.product_id, MP.style_id, MP.colorway_no, MP.design_id, MP.row_status, ch.colorway_id, ch.colorway_no

Understood. I had two different suggestions (i) the optimiser says that subquery takes less than a second, what is the actual time it takes? (ii) if it seems way too long, what is the diff when you turn the subquery into an optimally indexed temporary table?

Options: ReplyQuote


Subject
Written By
Posted
February 02, 2022 04:48PM
February 03, 2022 11:57AM
February 03, 2022 04:31PM
February 03, 2022 04:54PM
February 03, 2022 05:17PM
February 03, 2022 05:40PM
February 03, 2022 08:11PM
February 04, 2022 09:38AM
Re: Query does not use index
February 04, 2022 11:03AM
February 04, 2022 05:18AM
February 04, 2022 09:29AM
February 04, 2022 09:35AM


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.