mysql database creates large amounts of data

1. Prepare an insert sql:

INSERT INTO `t_game_record`(`id`, `game_id`, `viewer_id`, `guess_price`, `status`, `create_date`, `update_date`) VALUES (396, 511, 28679, 1000.00, '0', '2019-07-01 15:36:26', '2019-07-01 15:36:26');

2. Insert the above sql into the table where the data is to be created, that is, the "t_game_record" table;

        注:如果该表中有数据,则不需要再次插入该sql。

3. Prepare SQL for batch data creation:

insert into t_game_record(`game_id`, `viewer_id`, `guess_price`, `status`, `create_date`, `update_date`) select `game_id`, `viewer_id`, `guess_price`, `status`, `create_date`, `update_date` from t_game_record where game_id = 511 ;

Execute the sql, execute the sql multiple times, and the data will grow according to the power; (ie: 1 execution once with 2 sides, then execution with 4 sides, and then execution with 8 sides...)

Note: Remove the id in the table and insert the data with the id auto-incremented.
Insert image description here

Guess you like

Origin blog.csdn.net/bigge_L/article/details/108184211