I am having a requirement to reduce the run time for the job. Using strobe tool i found that one of the query involved in the program is taking time. The query is
WHERE Col1 = xxxx
AND col2 = 0
Here the subquery is having around 1000's of rows. Please help me to reduce the time for this query in developer point of view and also from dba point of view.
There might be two places where you can look for optimization -
a) First one, like Dick suggested, you can check the select query for performance, to reduce time taken. This includes checking for Indexscan, clustering etc.
b) Second, since your job is loading thousands of rows, you can consider changing the INSERT to LOAD. This will reduce time elapsed significantly.
Also, if due to some incorrect INSERT operation, you recieve non-zero SQLCODE, then I believe your job will abend and rest of the rows will also not be loaded until you restart it.
But if you consider using LOAD, all the rows will be loaded EXCEPT those which were invalid, giving you better control on the process. You can later choose to reject those rows, or correct and load them, but your process will not come to a halt.