#0124 · 方法
大表分批处理
这个批量更新要动 [表名] 的大量数据。改成按主键分批执行,每批 [数量] 行,每批之间留间隔,打印进度,中途失败可以从断点继续。不要一条语句锁住整张表。
This bulk update touches a lot of rows in [table]. Rewrite it to run in primary-key batches of [size], pause between batches, print progress, and resume from where it stopped if it fails. Never lock the whole table with one statement.
小杜
已贴 1,040 张上墙共收到 0 个章