Subject | Re: [ib-support] Re: Writing data in tables! |
---|---|
Author | Olivier Mascia |
Post date | 2001-01-30T11:03:45Z |
Yes, you're doing it wrong.
You are using an ExecuteImmediate in each loop.
You have to prepare, then execute that prepared statement.
I think I've seen a post from Jason Wharton warning you about that exactly.
Yours,
Olivier.
-- On 30/01/2001 10:22 +0000 simpor81@... wrote :
You are using an ExecuteImmediate in each loop.
You have to prepare, then execute that prepared statement.
I think I've seen a post from Jason Wharton warning you about that exactly.
Yours,
Olivier.
-- On 30/01/2001 10:22 +0000 simpor81@... wrote :
> Well the computer that I use is a Athlon800 and 256 RAM, and when I
> use the DSQL-component can I only make something like 1000 rows/sec???
>
> Maybe I'm using the wrong code or something like that.
>
> Here is the code anyway...
>
> IB_Transaction1->StartTransaction ();
> IB_Connection1->BeginBusy(true);
> IB_DSQL1->BeginBusy(true);
> IB_Transaction1->BeginBusy(true);
> IB_Transaction1->DisablePause ();
>
> for (int a = 0; a <= 5000; a++)
> {
> String aa = "INSERT INTO COUNTRY VALUES(" + IntToStr(a) + ", "
> + IntToStr(a) + ") ";
> IB_Transaction1->ExecuteImmediate(aa);
> this->Caption = IntToStr(a);
> Application->ProcessMessages ();
> }
>
> IB_Transaction1->Commit ();
> IB_DSQL1->EndBusy();
> IB_Connection1->EndBusy();
>
> IB_Transaction1->EndBusy();
> IB_Transaction1->EnablePause ();
>
>
> I must say thank you to all of you that have helped me so far. It's
> looks a bit brighter now actually. :) The program is a sort of
> simulator that needs to write 15000 rows and only the code with no
> writings to the database is taking 15 sec. The writing to the
> database is now taking 1:40 min + the 15 sec so almost 2 min.
>
> Is it possible to make Interbase run in the memory of a machine. From
> my knowledge is the writing to the harddrive the thing that takes the
> most time. So if you were able to put the hole database in the RAM
> then would it be really quick, wouldn't it.
>
> Just a little thought that I have had.
>
> Simon