-
March 24th, 2011, 02:19 AM
#1
Interest Calculation Job
Hi,
A program is written in C that uses database. It calculates interest of 1 crore accounts and updates the tables in the database. It does lot of validations before calculating interest of an account.e..g It does not calculate interst of dormant account. This job is taking 3 days for execution. What are the alternates to improve the performance.
i. Can I write a shell script to do this job? Will be there any performance improvement?
ii. Can I write a store procedure instead of C.
Pl suggest various effectie alternatives.
-
March 24th, 2011, 06:46 AM
#2
Re: Interest Calculation Job
-
March 24th, 2011, 07:16 AM
#3
Re: Interest Calculation Job
I don't know if this is homework or not, but without a lot more details about what it's doing now, it's hard to say how to do it better.
What's a crore?
-
March 24th, 2011, 08:38 AM
#4
Re: Interest Calculation Job
"A crore is a unit in the Indian numbering system equal to ten million"
-
March 24th, 2011, 08:59 AM
#5
Re: Interest Calculation Job
Originally Posted by alanjhd08
"A crore is a unit in the Indian numbering system equal to ten million"
That's not a really huge number. I can't imagine if taking three days for a computer to do 10 million interest calculations.
-
March 24th, 2011, 10:52 PM
#6
Re: Interest Calculation Job
This is not homework...Question is related to design......What are the common tips to do such 10 million interst calculation? Pl give me pointer of any article...
-
March 25th, 2011, 04:25 AM
#7
Re: Interest Calculation Job
Originally Posted by forumuser11@gmail.com
Question is related to design......What are the common tips to do such 10 million interst calculation?
You identify what part of the application is slow, and then you improve it.
Regards,
Paul McKenzie
-
March 25th, 2011, 05:54 AM
#8
Re: Interest Calculation Job
Originally Posted by GCDEF
That's not a really huge number. I can't imagine if taking three days for a computer to do 10 million interest calculations.
I am by no means an expert on databases, but if it really does take three days to do 10 million updates then that works out to about 38.58 calculations per second - or 25.92 ms per calculation - which doesn't sound unreasonable to me. For a simple C program, yes, that's slow. But for a database that has to update tables in addition to doing the calculations? Maybe not. For a system with a remote back end and a large number of users, that may actually be fast.
Even though the program is written in C, I wonder if a database forum might provide more relevant info.
-
March 25th, 2011, 07:14 AM
#9
Re: Interest Calculation Job
Originally Posted by 0xC0000005
I am by no means an expert on databases, but if it really does take three days to do 10 million updates then that works out to about 38.58 calculations per second - or 25.92 ms per calculation - which doesn't sound unreasonable to me. For a simple C program, yes, that's slow. But for a database that has to update tables in addition to doing the calculations? Maybe not. For a system with a remote back end and a large number of users, that may actually be fast.
Even though the program is written in C, I wonder if a database forum might provide more relevant info.
He didn't say if he's updating the database or anything about what he's doing. Whatever it is, it shouldn't take more than a few minutes at most. Possibly he's doing a lot of queries of unindexed fields, but who knows. It certainly doesn't take three days to write 10 million records to a database.
-
March 25th, 2011, 09:13 AM
#10
Re: Interest Calculation Job
Originally Posted by GCDEF
He didn't say if he's updating the database or anything about what he's doing. Whatever it is, it shouldn't take more than a few minutes at most. Possibly he's doing a lot of queries of unindexed fields, but who knows. It certainly doesn't take three days to write 10 million records to a database.
With all due respect to your outstanding reputation here, it all boils down to whether or not you agree that 1/40 of a second is a long time to access a database record from a local C program, do some calculations, then update the record. In order for this to happen in a few (3 for example) minutes as you suggest, the rate would have to be nearly 56,000 updates per second or 18 microseconds per update. Probably more than reasonable for a C program in the absence of a database - but for the reasons I mentioned before: for example, an enterprise system with lots of users and a remote back end - I do not think it is necessarily reasonable.
Granted, I am assuming inefficient access - grab a single account, calculate interest, then update the database - but that is my interpretation. Again, I don't claim to be an expert on database access, it's just my humble opinion.
-
March 25th, 2011, 09:22 AM
#11
Re: Interest Calculation Job
Originally Posted by 0xC0000005
With all due respect to your outstanding reputation here, it all boils down to whether or not you agree that 1/40 of a second is a long time to access a database record from a local C program, do some calculations, then update the record. In order for this to happen in a few (3 for example) minutes as you suggest, the rate would have to be nearly 56,000 updates per second or 18 microseconds per update. Probably more than reasonable for a C program in the absence of a database - but for the reasons I mentioned before: for example, an enterprise system with lots of users and a remote back end - I do not think it is necessarily reasonable.
Granted, I am assuming inefficient access - grab a single account, calculate interest, then update the database - but that is my interpretation. Again, I don't claim to be an expert on database access, it's just my humble opinion.
I work with databases a lot. He hasn't said what he's doing so there's no point in speculating, but if it takes more than a few minutes, something is really wrong. As I said, I my best guess is a lot of queries on large unindexed tables, but there's no way of telling unless he explains himself better.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|