UPDATE SomeTable SET X = null, Y = null
in a (61 million rows, 6.4 GB, MyISAM) table takes about 55 minutes .
(UPDATE SomeTable SET X = null, Y = null
(在6100万行,6.4 GB,MyISAM表中) UPDATE SomeTable SET X = null, Y = null
大约需要55分钟 。)
(MySQL 5.7, Windows 10 on i7 laptop, mains cable plugged in, MySQL running at about 30% CPU). ((MySQL 5.7,i7笔记本电脑上的Windows 10,已插入电源线,MySQL运行约30%的CPU)。)
Columns X and Y are not part of any index. (X和Y列不属于任何索引。)
(I needed to run this query to null some previously entered erroneous data.) ((我需要运行此查询以使一些以前输入的错误数据为空。))
But: ALTER TABLE SomeTable ADD COLUMN X FLOAT NULL DEFAULT NULL, ADD COLUMN Y FLOAT NULL DEFAULT NULL
, which requires a complete read/write of table plus index takes only about 15 minutes.
(但是: ALTER TABLE SomeTable ADD COLUMN X FLOAT NULL DEFAULT NULL, ADD COLUMN Y FLOAT NULL DEFAULT NULL
,这需要对表和索引进行完整的读/写操作仅花费约15分钟。)
What is the problem here?
(这里有什么问题?)
ask by Matthias Otto translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…