Subject | RE: [IBO] Loop Faster |
---|---|
Author | Jerry Sands |
Post date | 2008-07-16T15:18:52Z |
Can you do the math with SQL?
UPDATE SomeTable
SET NumericField = (NumericField * 2) + 1 / 3
That way you let the server do the work and it should speed things up
If the math is pretty complex maybe you should write a user function or call
a stored procedure but try to do it all in a single update statement or code
it in a stored procedure
Jerry Sands
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Gordon Hamm
Sent: Wednesday, July 16, 2008 9:11 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Loop Faster
Hi,
I need t loop through 10 million records and do some math on on some values
and post result to a field (Same table).
It works fine..
I do this with 2 queries..One to loop, one to update etc.
I am
1. Committing the transaction every 1000 records for performance.
2. Turn on the UniDirectional property to use less memory.
Is there any sort of buffering that I can set to increase performance?
The whole process takes about 2 hours, Id like to try to improve that as I
have to run it about once a week.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
UPDATE SomeTable
SET NumericField = (NumericField * 2) + 1 / 3
That way you let the server do the work and it should speed things up
If the math is pretty complex maybe you should write a user function or call
a stored procedure but try to do it all in a single update statement or code
it in a stored procedure
Jerry Sands
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Gordon Hamm
Sent: Wednesday, July 16, 2008 9:11 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Loop Faster
Hi,
I need t loop through 10 million records and do some math on on some values
and post result to a field (Same table).
It works fine..
I do this with 2 queries..One to loop, one to update etc.
I am
1. Committing the transaction every 1000 records for performance.
2. Turn on the UniDirectional property to use less memory.
Is there any sort of buffering that I can set to increase performance?
The whole process takes about 2 hours, Id like to try to improve that as I
have to run it about once a week.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]