Hi All !
let's say there is a piece of java code that performs 100,000 INSERTs (into TABLE tab1) in a loop. The db2 connection of the java program does a autocomitt. Therefore, under the current execution, it does a 100,000 commits.
In order to tune this insert program. I proposed to turn off the auto commit and commit the inserts on a frequency as defined in the code. Which I know will show a definite gain in performance.
upon further investigation, I found that the table tab1 is always going to be empty at the begining of each run. So my question to you is will I be even better off if
- I perform a CREATE TABLE with the NOT LOGGED INITIALLY clause, for every run.
- turn off auto commit
- perform one commit at the end of all INSERTs
1. Will this be the equivalent of doing a LOAD REPLACE with LOG NO ?
2. Will I be better off doing a commit at the end of all inserts (one a table created for every run using CREATE TABLE with NOT LOGGED INITIALLY) visa-vis doing only one CREATE TABLE and performing COMMITs at a regular frequency ?
thanks.
Anil
Also, could someone send me a piece of java code that does turns off the autocommit and performs commit within the program. That would save our developer's effort and trying to figure out 'how to turn off autocommit ? '