为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:dm8_20230817_x86_rh7_64.zip
【操作系统】:redhat 7
【CPU】:Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz
【问题描述】*:我做了一个for循环测试,每次循环包含插入一行记录到一个表和更新另一个表的一条记录,两个表大概各有20个字段。
循环10万次,测试出来的结果,每分钟500多笔,感觉性能比较低。服务器的配置挺高的,32C,128G内存,请问有什么优化的思路呢。
begin
for i in 1..100000 loop
insert into server_sell (ticket_code, station_id, sell_term_code,
valid_term_code, run_code, sell_datetime, withdraw, print_success, play_type, play_id,
bet_way, operator, bet_code, bet_num, sell_person_id, sell_city_id, id_code, photo_code,
bank_code, other_station_id, other_ticket_code, other_ticket_sendno) values
(to_char(i), '123456', '0', '0', 0, sysdate, 0, 0, 0, 0, 0, '0', '0', 0,'0', '0', '0', '0', '0', '0', '0', '0');
update server_monery set station_monery = station_monery+10 where station_id = '500';
end loop;
commit;
end;
/
补充:
测试代码如下
begin
for i in 1..100000 loop
insert into server_sell (ticket_code, station_id, sell_term_code,
valid_term_code, run_code, sell_datetime, withdraw, print_success, play_type, play_id,
bet_way, operator, bet_code, bet_num, sell_person_id, sell_city_id, id_code, photo_code,
bank_code, other_station_id, other_ticket_code, other_ticket_sendno) values
(to_char(i), '123456', '0', '0', 0, sysdate, 0, 0, 0, 0, 0, '0', '0', 0,'0', '0', '0', '0', '0', '0', '0', '0');
update server_monery set station_monery = station_monery+10 where station_id = '500';
commit;
end loop;
end;
/