Subject | Re: [IBO] ib_query slow copy 300.000 records. |
---|---|
Author | Jason Wharton |
Post date | 2009-10-08T04:58:04Z |
Use calls to BeginBusy() and EndBusy so that you avoid cursor flickering.
Jason
Jason
----- Original Message -----
From: "send2iwan" <send2us@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, October 07, 2009 2:09 AM
Subject: Re: [IBO] ib_query slow copy 300.000 records.
first thanks all,
i already set both unidirectional to true, that's didn't help.
i'll try using TIB_DSQL.
thanks again.
--- In IBObjects@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@...> wrote:
>
> Generally, I'd say using a parameterised TIB_DSQL for import is superior
> to using TIB_Query. Also, try to avoid using ParamByName (or FieldByName)
> for your TIB_DSQL for each iteration, that will be very slow (I know
> nothing about TQuery). Committing for each 10000 sounds like a good idea.
> Here's a simple example that isn't checked in any way (and that doesn't
> include any commits):
>
> var
> MyValue1,
> MyValue2: TIB_Column;
> begin
> TIB_DSQL1.sql.clear;
> TIB_DSQL1.sql.ADD('INSERT INTO MyTable(MyField1, MyField2) VALUES
> (:MyValue1, :Myvalue2)');
> TIB_DSQL1.Prepare;
> MyValue1:=TIB_DSQL1.ParamByName('MyValue1');
> MyValue2:=TIB_DSQL1.ParamByName('MyValue2');
> tQuery1.Open;
> while not tQuery1.eof do
> begin
> MyValue1.AsInteger:=tQuery1.Fields[0].AsInteger;
> MyValue2.AsString:= tQuery1.Fields[1].AsString;
> TIB_DSQL.Execute;
> tQuery.Next;
> end;
> end;
>
> Doing things this way ought to make your import considerably faster, I'd
> expect a few thousand inserts per second, but of course, lots of things
> matters for speed.
>
> HTH,
> Set
>
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Behalf Of send2iwan
> Sent: 7. oktober 2009 09:43
> To: IBObjects@yahoogroups.com
> Subject: [IBO] ib_query slow copy 300.000 records.
>
> hi all,
>
> i am using TIB_Query for import data from dbf (300.000 records)
>
> every 10000 i do hard commit, after 100.000 records looping go very slow.
> for dbf i am using TQuery.
>
> slow i mean for 300.000 records i spent 3 hours.
> how to speed up?
>
> please help, thanks.
>
> Iwan
>
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links