简体   繁体   中英

Very slow inner join query

I need to optimalize this query for being fast (takes around 10 minutes)

UPDATE year_2021 t1 
        INNER JOIN pricelist t2 
             ON t1.material = t2.material
SET t1.rabat = t2.rs

Table year_2021 have 30k rows and table pricelist have 60k rows.

Is it really ok, this query takes 10 minutes or it is wrong?

Thank you!

On pricelist have INDEX(material, rs)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM