Subject Re: [IBO] Firebird performance / IBO
Author Svein Erling Tysvaer
Normally, I'd say 1150 records per second when inserting a record
consisting of two BigInt fields is slow when there's no network
involved, but it depends on what you mean by 'more to the process'.

Try code similar to this:

var
BigIntField1,
BigIntField2,
BigIntField1In,
BigIntField2In: TIB_Column;
begin
TIB_DSQL1.Prepare;
TIB_Cursor1.Prepare;
BigIntField1:=TIB_DSQL1.ParamByName('BigIntField1');
BigIntField2:=TIB_DSQL1.ParamByName('BigIntField2');
BigIntField1In:=TIB_Cursor1.FieldByName('BigIntField1');
BigIntField2In:=TIB_Cursor1.FieldByName('BigIntField2');
TIB_Cursor1.First;
while not TIB_Cursor1.eof do
begin
BigIntField1.AsInteger:=BigIntField1In.AsInteger;
BigIntField2.AsInteger:=BigIntField2In.AsInteger;
try
TIB_DSQL1.Execute;
except
end;
TIB_Cursor1.Next;
end;
TIB_Transaction1.Commit;
end;

I used TIB_Cursor1 as the source and TIB_DSQL1 as the target. If the
data aren't in Firebird, you obviously do not want TIB_Cursor1. You also
have to change 'AsInteger' to whatever is the BigInt equivalent (I
rarely use them and don't remember what it is) and may want to commit
every 10000 records or so rather than at the end of it all. I doubt it
is the quickest possible solution, but it should be reasonably quick and
I'd be disappointed with less than 4000-5000 records per second
(hopefully it is quicker). The most important bits are to avoid
ParamByName within the loop and committing too often.

HTH,
Set

Robert martin wrote:
> Hi
>
> The record is a small linking record with two bigInt fields.
>
> Im not sure about the performance yet but we are talking about 20% of
> the job done in 3hrs (with the slow method), although there is more to
> the process than just this table. I don't know how many records to
> expect yet but it appears to be adding about 1150 records per second at
> the moment.
>
> Which seems pretty good?
>
> Machine is a AMD Athalon 3000 with IGB Ram. An is being used for other
> development while this process takes place.
>
> ....
> I have just retested and the performance is down to 666 records per sec
> (evil sounding isn't it :) )
>
> Me thinks I need to deactivate an index :)