Imagine that you got a file with a list of keys that specifies entries in some table that need to be set to some value. The problem is that the list is huge and the table itself is huge too. And as usual, your job needs to be done quickly. There is one way how to do the job with MySQL:
create table tmp (entry text);
load data infile '/tmp/input.txt' into table tmp ignore 1 lines (@var) set entry=substring(@var, 15, 6);
update data,tmp set data.something=something where tmp.entry=data.key;
drop table tmp;
If you get complains about ‘file not found’ try to use ‘load local data’ instead of ‘load data’. And don’t forget that you are not limited on to update only one column to a constant, you can load other values from the input file and update table accordingly too.