Use of Read Each
for a batch program with restart logic, opens and closes the cursor repeatedly
causing performance degradation
Best
Practice:
Instead of invoking the program
repeatedly, it is replaced by the following logic:
...
Set commit_count to 0
Set commit_freq to 10000
Read Each table (with
cursor hold)
...
commit_count = commit_count + 1
If commit_count = commit_freq Then
USE
ext_commit_action_block
...
End Read Each
...
Note: ext_commit_action_block is an external action block, which
contains only SQL statement: COMMIT.
No comments:
Post a Comment