Subject | Re: [IBO] IBO 10x slower than ibx doing Insert |
---|---|
Author | Lucas Franzen |
Post date | 2006-07-11T21:33:50Z |
Magni Thor Mortensen schrieb:
It should runder in less than one second unless you're trying to run it
on a real old machine ;-)
IBOt.Isolation := tiCommitted;
IBOMonitor to find out what's going wrong.
Luc.
> Why is IBO almost 10x slower than InterBase Express when doing bulkRidiculous!
> inserts with prepared statements ?
>
> The following test takes ~10 seconds with IBO, but only ~ 1 second with
> IBX with 1.000 inserts,
> 10.000 takes ~ 45 seconds with IBO
It should runder in less than one second unless you're trying to run it
on a real old machine ;-)
> procedure TForm1.Button1Click(Sender: TObject);The default Isolation is tiConcurrency, so set:
> var
> IBOc : TIB_Connection;
> IBOt : TIB_Transaction;
> IBOq : TIB_DSQL;
> start, stop, dur : TTime;
> i : Integer;
> begin
> IBOc := TIB_Connection.Create(nil);
> IBOt := TIB_Transaction.Create(nil);
IBOt.Isolation := tiCommitted;
> IBOq := TIB_DSQL.Create(nil);Never set the Databasename property, use the PATH property.
> IBOc.DatabaseName := 'c:\firebird\examples\EMPLOYEE.FDB';
> IBOc.Username := 'sysdba';Maybe be you should assign the IB_Transaction as well.
> IBOc.Password := 'masterkey';
> IBOc.Connect;
> IBOq.IB_Connection := IBOc;
> IBOq.SQL.Text := 'INSERT INTO COUNTRY (COUNTRY, CURRENCY) VALUESIf this is still slower then try it with components _on_ the form and an
> (:COUNTRY, :CURRENCY)';
> IBOq.Prepare;
> start := Now;
> IBOt.StartTransaction;
> for i := 0 to 10000 do begin
> IBOq.ParamByName('COUNTRY').AsString := 'a'+IntToStr(i);
> IBOq.ParamByName('CURRENCY').AsString := 'bla';
> IBOq.Execute;
> end;
> IBOt.Commit;
> stop := Now;
> dur := stop - start;
> showMessage(FormatDateTime('hh:ss:zz',dur));
> end;
IBOMonitor to find out what's going wrong.
Luc.