drop database database test_uuid;
create database test_uuid;
use test_uuid;
drop table test_id;
create table test_id (
  id varchar(37) not null,
  name varchar(128),
  primary key(id)
);

DROP PROCEDURE LoopDemo;
 
DELIMITER $$
CREATE PROCEDURE LoopDemo()
BEGIN
    DECLARE x  INT;
    DECLARE uuid VARCHAR(37);
        
    SET x = 1;
        
    loop_label:  LOOP
        IF  x > 1000000 THEN 
            LEAVE  loop_label;
        END  IF;
            
        SET  x = x + 1;
        SET uuid = CONCAT((10000000 + x), "-638a-11ea-a6bb-e0d55e6863be");

        insert into test_id (id, name) values (uuid, 'Reading table information for completion of table and column names');

    END LOOP;
END$$

DELIMITER ;


CALL LoopDemo();

-- my.cfn выключен синхронный режим
-- insert: 1_000_000
-- Query OK, 1 row affected (26.39 sec)

-- time echo "use test_uuid; select * from test_id" | sudo mysql >/dev/null
-- real	0m1.122s
-- user	0m0.810s
-- sys	0m0.062s
