Home > database >  Using a stored procedure function, USES the modified table circulation mode of field data, only a pa
Using a stored procedure function, USES the modified table circulation mode of field data, only a pa

Time:01-08

Because the data volume is too big so use stored procedure function,
Using modified table cycle mode field data, the result is only performed as a part of the not fully completed, the reason is what

Stored in the process of the loop body is as follows:
The SET of num=CEIL (@ count_num/2000000);
A: WHILE I & lt; Num DO
The SET m=I * 2000000;
The SET I:=I + 1;
The SET I * n=2000000;
The SET @ m=m; The SET @ n=n;
SET @ com=CONCAT (" UPDATE ", @ tablename_1, "a INNER JOIN", @ tablename_2, "v ON a." @ var, "=v," @ var, "SET a.," @ var_read, "WHERE d=v.i Anderson, d & gt;" @ m, "AND Anderson, d & lt;="@ n,";" );

Simplify the above statement:
The UPDATE @ tablename_1 a INNER JOIN @ tablename_2 v
ON a. @ var=v @ var SET a. @ var_read=v.i d WHERE Anderson, d & gt; @ m AND Anderson, d & lt;=@ n;

PREPARE STMT FROM @ com;
- perform predefined
The EXECUTE STMT.
DEALLOCATE PREPARE STMT.
END WHILE a;

Cycles of the stored procedure body have completely completes, the result is @ m=30000000; @ n=32000000
The modified record total length as @ count_num=30970574 are modified rules within the scope of the id of the

After perform the procedure does not appear error,
First determine the modified record in table @ tablename_1 conditions can be found in the reference table @ tablename_2 100%,

By querying the
SELECT count (var17) FROM data_min5. Fig_min5_9901
WHERE var17 IS not null;

Results the modified record only 26210251, but not all records 30970574

This also sets the 2 g SET GLOBAL innodb_buffer_pool_size=2147483648;

Please teacher development in this is that causes can't modify any record

CodePudding user response:

Found the reason, id number and record length is not the same, records many times written to make id number greater than the record number, should set the id again
  • Related