I have developed a user bulk upload module. There are 2 situations, when I do a bulk upload of 20 000 records when database has zero records. Its taking about 5 hours. But w
Indexes are your friend.
UPDATE User ... WHERE id = ... -- Desperately needs an index on ID, probably PRIMARY KEY.
Similarly for renameSource.
SELECT *
FROM `User` `t`
WHERE `t`.`firstName`='Franck'
AND `t`.`lastName`='ALLEGAERT '
AND `t`.`dateOfBirth`='1971-07-29'
AND (userType NOT IN ("1"))
LIMIT 1;
Needs INDEX(firstName, lastName, dateOfBirth); the fields can be in any order (in this case).
Look at each query to see what it needs, then add that INDEX to the table. Read my Cookbook on building indexes.