Answer the question
In order to leave comments, you need to log in
How to quickly update a row in a table by VARCHAR column?
There is a MySQL DB, 75 lines. Fields id, mail1, mail2. There is a csv file, 32 lines. Fields mail, phone. There is a server on xeon, 128 RAM. It is necessary to add phones to the database by matching emal. A request like UPDATE users SET phone="phone" WHERE mail1="mail" OR mail2="mail" takes 5 seconds. Accordingly, 32m lines - 1730 days. We need something radically faster, hundreds of times faster.
Answer the question
In order to leave comments, you need to log in
Well, you can start by simply dragging csv into a temporary table and hanging the necessary keys / indexes on it.
I think after that an update (more precisely two) with inner join on this temporary plate will be fast enough.
Then you will have to deal with dirty hacks such as temporary amputation of indexes, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question