DROP PROCEDURE IF EXISTS insert_batch; CREATE PROCEDURE insert_batch() BEGIN DECLARE n int DEFAULT 1; loopname:LOOP INSERT INTO `mlcloud`.`vm_snapshots` (`task_id`, `size`, `time_used`, `create_time`) VALUES ('148', '431644213248', '447', '1556041462'); SET n=n+1; IF n=1000000 THEN LEAVE loopname; END IF; END LOOP loopname; END; CALL insert_batch();
总耗时:
[SQL]
CALL insert_batch();
受影响的行: 1
时间: 873.795s