I am using MemSQL 6.5, to run a test. Before the test I need to insert about eighty million rows in a MemSQL table. It’s like:
DELIMITER // CREATE OR REPLACE PROCEDURE initdata(m int) AS DECLARE counter1 int = 0; counter2 int = 0; BEGIN WHILE counter1 < 36000 LOOP INSERT INTO TableA; WHILE counter2 < 2400 LOOP INSERT INTO TableB; counter2 += 1; END LOOP; counter1 += 1; ...
There are two ways I tried:
Create a procedure like above, in a file initiate.sql, and run like: memsql < initdata.sql
The speed is 9K per sec.
Using a Golang program, to create insert segments and send to MemSQL.
The speed is around 30-40K per sec.
In this case, I need to wait for some time for initialising data. So i would like to know, how can I increase the speed of inserting records? Where can i optimise the process? Many thanks!