Back

mysql - 解决错误:The total number of locks exceeds the lock table size

发布时间: 2023-03-06 08:01:00

refer to:
https://blog.csdn.net/weixin_40683253/article/details/80762583

有个巨大的表,500G, 想要删掉其中的一些东西,通过重新创建表,保留某些记录的方式:

create table2 like table1;

insert into orders_temp select * from orders where state = 100;

这样的方式,结果卡在了112G 左右。 不工作了。

卡住了6w seconds之后。抛出异常。

解决办法:

show variables like "%_buffer%";
SET GLOBAL innodb_buffer_pool_size=6g;      或者  6388608000

就可以了。

Back