Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
My requirement is to validate db2 rows.I will give a brief description on what my project is.I need to validate the bill generated on previous day based on some formulas.I have only Read access to DB2.As part of testing i fetch all the previous date records(which is considered as input for calculations) and store in local SQL DB. Then i start calculating the values with formula and finally i will validate with some other tables on the db2.
I have written a test method to validate the db2 rows. But i feel its not an efficient method to validate millions records.So any one please shed up some lights on which i can improve the execution speed.

Given Below are the steps i am following.
Step1: Fetch all input values from DB2 and save in Local SQL. For this i am using datatable.I have a written a stored procedure to insert values by passing datatable as parameter.
Step2: Fetch all values from SQL for the calculation. I will store all the values in dataset.
Step3: iterate through the datarows and do calculations. store calculated values in variables.
Step4: Make a db2 Call to get the retrieved values.
Step5: Compare with calculated value and retrieved value. If values matches its pass other wise fail.
Step6: Save calculated&Retrived values in SQL for Reporting
step7: Generate Report

My questions are
Can i use threading? If yes please give some idea
Can i execute the test in batches ie a 1000 records each.

Please give me some ideas to step further
Posted
Updated 9-May-15 1:18am
v2

1 solution

"Can i use threading?"
We can't tell you: the problem is that we have no idea what your calculations are trying to do. If they are independent, then possibly you can use threading within individual steps, but to my mind Step 3 depends on Step 2 completing, Step 4 depends on Step 3 completing, and so on - so you can't use threading to run your steps at the same time.

"Can i execute the test in batches ie a 1000 records each."
No idea. We don't know what you are doing with your records - see threading above.

Seriously, you are going to have to look at the process as a whole and see how it works - the details are critical in decisions like this. But beware: threading is not a "get out of jail free" card for performance problems: you can only execute as many thread simultaneously as you have free cores, and each thread adds it's own overhead in thread setup and management, so it is quite common to find that the "threaded" version takes longer to finish than the "unthreaded" version, particularly if the tasks are small but numerous.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900