I am trying to update the LARGE MyISAM table (25 million records) using a CLI script. The table is not locked / is not used by anything else.
I decided instead of making single UPDATE queries for each record, I could also use the CASE function.
The id field is PRIMARY. I suspect the next request should take milliseconds.
UPDATE `table` SET `uid` = CASE WHEN id = 1 THEN 2952 WHEN id = 2 THEN 4925 WHEN id = 3 THEN 1592 END
Lo and lo, the request is processed by the CPU and does not end forever.
Then, to my surprise, I found out that the query updates all 25 million rows, putting NULL in rows that I did not specify.
What is the purpose of this? Can I just update MASS for certain rows without updating 25 million rows each time I execute this query? Or do I need to make separate updates and then commit?
mysql
nick 05 Oct 2018-12-12T00: 00Z
source share