Subject Re: [IBO] Volume Data Adding
Author Paul Little
Geoff,

WOW!!

Thanks, I used the column reference method (ib_dsql.Params[0].astype :=
x) and it has knocked nearly 50% off my excecution time. I'm well
pleased, I just wish I'd discovered it three months ago!

I just have one question. I am a bit confused as to where I need to put
the beginbusy and the try statements. My code is structured like this:

set up sql statements }
prepare dsql's } -- 29 of these

begin mainloop (between 100 and 10000
iterations)
begin loop (between 10 and 120 iterations)
calculate values
transfer values to dsql parameters using above method
execdsql (8/29)
end loop
calculate mean values from above (using SP)
begin loop (same as above)
calculate values
transfer values to dsql parameters using above method
execdsql (remaining dsql's)
end loop
if mainloop counter mod 50 = 0
transaction.commit
end mainloop
transaction.commit
unprepare

As you can see I have two loops nested inside a main loop. The first
inner loop calculates some basic values and stores them in the relevant
tables. Then the mean values of some of fields of those tables is
calculated and these values are used as the input for the next loop
which calculates the remaining values and stores them in their tables.
Every 50 iterations of the main loop I commit and once the main loop is
finished I do a further commit (in case the iterations were not
divisible by 50).

I'm thinking that the beginbusy/try should to go outside of the main
loop with the last commit going in the "finally" command. Does this
sound right or should there be seperate beginbusy/try's for the inner
loops?

Paul

Geoff Worboys wrote:
>
>
> The use of column references in loops is something that we may appear
> to push pretty hard. Thats because it really is worth it in tight
> loop situations, you will see significant improvement in performance
> on long running loops.
>
> HTH
>
> Geoff Worboys