
mysql 批量插入数据过多的解决方法
使用场景:测试时需要插入100w的数据,跑sql脚本插入非常慢。存储过程如下://DELIMITERDROP PROCEDURE if EXISTS createAmountCount;create PROCEDURE createAmountCount()BEGINDECLARE i int;set i=0;drop table if exists person ;create table person(id

mysql 批量删除数据
批量删除2000w数据使用delete from table太慢//DELIMITERDROP PROCEDURE if EXISTS deleteManyTable;create PROCEDURE deleteManyTable()BEGINDECLARE i int;set i=1;while i2001DODELETE FROM `f_log` WHERE (`id` 95000000) ORDER BY `id` LIMIT 10000;SELE

mysql 压力测试之批量插入自增字段不连续问题
Gaps in auto-increment values for“bulk inserts”Withinnodb_autoinc_lock_modeset to 0 (“traditional”) or 1 (“consecutive”), the auto-increment values generated by any given statement will be consecutive, without gaps, because the table