gpt4 book ai didi

mysql - 如何加快 MySQL 的批量更新速度

转载 作者:行者123 更新时间:2023-11-29 19:03:00 24 4
gpt4 key购买 nike

我想在我的表中更新此邮件。为此列创建了索引。但是这次更新需要1个多小时,无论服务器是否为空,都需要很多时间才能更新。为什么很慢?我希望每天更新超过 200 万行。如何加快这个查询。

update table1 SET list='mm' where mail='sqkw@gmail.com';
update table1 SET list='mm' where mail='wefr@gmail.com';
update table1 SET list='mm' where mail='dkfjgk@gmail.com';
update table1 SET list='mm' where mail='jkdfj@gmail.com';
update table1 SET list='mm' where mail='tyhr@gmail.com';
update table1 SET list='mm' where mail='dsfdsf@gmail.com';
update table1 SET list='mm' where mail='dfjs@gmail.com';
update table1 SET list='mm' where mail='sdjf@gmail.com';
update table1 SET list='mm' where mail='sfs@gmail.com';
update table1 SET list='mm' where mail='wef@gmail.com';
update table1 SET list='mm' where mail='srfsf@gmail.com';
update table1 SET list='mm' where mail='sadsd@gmail.com';
update table1 SET list='mm' where mail='ggu@gmail.com';
update table1 SET list='mm' where mail='ft@gmail.com';
update table1 SET list='mm' where mail='cvsdf@gmail.com';
update table1 SET list='mm' where mail='dvsd@gmail.com';
update table1 SET list='mm' where mail='dsfswr@gmail.com';
update table1 SET list='mm' where mail='sdgs@gmail.com';
update table1 SET list='mm' where mail='werwe@gmail.com';
update table1 SET list='mm' where mail='eg@gmail.com';
update table1 SET list='mm' where mail='geg@gmail.com';
update table1 SET list='mm' where mail='fvgdfs@gmail.com';
update table1 SET list='mm' where mail='ww1@gmail.com';
update table1 SET list='mm' where mail='ger@gmail.com';
update table1 SET list='mm' where mail='sf@gmail.com';
update table1 SET list='mm' where mail='fgdeg@gmail.com';
update table1 SET list='mm' where mail='wfgwe@gmail.com';
update table1 SET list='mm' where mail='asd@gmail.com';
update table1 SET list='mm' where mail='dfg@gmail.com';
update table1 SET list='mm' where mail='3r@gmail.com';
update table1 SET list='mm' where mail='geg@gmail.com';
update table1 SET list='mm' where mail='sdvsd@gmail.com';

最佳答案

UPDATE table1
SET list='mm'
WHERE mail IN('sqkw@gmail.com', 'wefr@gmail.com', ...)

关于mysql - 如何加快 MySQL 的批量更新速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43715754/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com