Saturday, March 28, 2009

inserting a billion numbers in a mysql table

mysql.exe -u root -p < proc.sql

proc.sql contains :

use mbm_db;

delimiter //

create procedure sp4()

begin

declare i int;

set i = 0;

while(i < 1000000000) do
set i = i+1;
insert into test_table values(i);
end while;
end;
//

delimiter ;
call sp4();

No comments:

Blog Archive