Re: Interest Calculation Job
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?
Re: Interest Calculation Job
"A crore is a unit in the Indian numbering system equal to ten million"
Re: Interest Calculation Job
Quote:
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.
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...
Re: Interest Calculation Job
Quote:
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
Re: Interest Calculation Job
Quote:
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.
Re: Interest Calculation Job
Quote:
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.
Re: Interest Calculation Job
Quote:
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.
Re: Interest Calculation Job
Quote:
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.