Update inner join is slow and does not occupy CPU as if it were dormant.

Business description:
Table sor contains about 150 million rows of data, including card access data.
Table sta contains about 4 million rows of data and contains statistics for table sor.
now you need to update a column in Table An according to Table B. the code is as follows:
`UPDATE source_data_cameraPoint_201811NA sor
INNER JOIN statis_carThrough_201811NA sta ON sor.carPlate=sta.carPlate AND sta.UrbanWdayDCount > 0
SET sor.dataValid= (case when sta.UrbanWdayDCount > = 5 then 3 when sta.UrbanWdayDCount > 0 then 2 else 1 end)
WHERE sor.dataValid=1
`
problem: now this code is stuck in Sending Data, but the CPU does not work. The occupancy has been floating at 5-7%, which is 100% normally.
extremely confused, please give me your advice.


Expain:

:
sor:


sta:

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

May.26,2022

strangely, it works when the index on the carPlate field is disabled.

Menu