Subject | RE: [ib-support] Re: Writing data in tables! |
---|---|
Author | Art Metz |
Post date | 2001-01-29T18:45:38Z |
Simon,
expectations. (Suggestions will follow.)
2. On what basis do you expect this to take one second?
3. If you're trying for a 120-fold increase in speed, then "a little
bit faster" won't help.
Suggestions and requests for additional information:
1. Are you doing the inserts locally or across a network? The network
bandwidth will kill you.
2. How large are the records? Are we talking 100 bytes/rec? 10,000
bytes/rec?
3. How are you doing the inserts? In particular, a sequence like
myCursor.Insert;
myCursor.FieldByName('Field1').AsInteger := 0 ;
myCursor.FieldByName('Field2').AsString := 'hello' ;
. . .
myCursor.Post ;
should be replaced with a TIB_DSQL. Prepare the Insert statement
once, fill in the parameters, and post each row.
4. Deactivate any indexes on the table(s) before you start, and
reactivate them after you do all the inserts.
5. Are there any Insert triggers? Any referential integrity rules that
the engine must check (ie, foreign keys)? Disable them as well.
6. Can you use a TIB_DataPump component?
7. Can you do intermediate Commits?
Hope this helps,
Art
Art Metz
AMetz@...
> Well I have tried to use ibobjects and it's going to slow.If IBO is too slow, then you need to rethink your approach or your
expectations. (Suggestions will follow.)
> In my program does I heva to write 15000 post to tables, the primary1. Do you mean you're trying to post 15000 records?
> goal is that this will take just a sec.
> Now it's taking (with ibobjects) around 2 min.
> So I did think that using Interbase API
> directly would make this a little bit faster.
2. On what basis do you expect this to take one second?
3. If you're trying for a 120-fold increase in speed, then "a little
bit faster" won't help.
> Is there any other way to read very fast to Interbase???Why "read"? I thought the problem was to write.
Suggestions and requests for additional information:
1. Are you doing the inserts locally or across a network? The network
bandwidth will kill you.
2. How large are the records? Are we talking 100 bytes/rec? 10,000
bytes/rec?
3. How are you doing the inserts? In particular, a sequence like
myCursor.Insert;
myCursor.FieldByName('Field1').AsInteger := 0 ;
myCursor.FieldByName('Field2').AsString := 'hello' ;
. . .
myCursor.Post ;
should be replaced with a TIB_DSQL. Prepare the Insert statement
once, fill in the parameters, and post each row.
4. Deactivate any indexes on the table(s) before you start, and
reactivate them after you do all the inserts.
5. Are there any Insert triggers? Any referential integrity rules that
the engine must check (ie, foreign keys)? Disable them as well.
6. Can you use a TIB_DataPump component?
7. Can you do intermediate Commits?
Hope this helps,
Art
Art Metz
AMetz@...
> -----Original Message-----
> From: simpor81@... [mailto:simpor81@...]
> Sent: Monday, January 29, 2001 10:08 AM
> To: ib-support@yahoogroups.com
> Subject: [ib-support] Re: Writing data in tables!
>
>
> Well I have tried to use ibobjects and it's going to slow. And the
> C++ code that you can get on www.ibpp.org doesn't seem to work for
> me, so I tried to take a try for my self and it doesn't work at all.
>
> In my program does I heva to write 15000 post to tables, the primary
> goal is that this will take just a sec. Now it's taking (with
> ibobjects) around 2 min. So I did think that using Interbase API
> directly would make this a little bit faster.
>
> In my database I have a table that looks pretty much like the
> DEPARTMENT table in employee.gdb, it's in a table like that, that I
> would like to write 15000 posts.
>
> Is there any other way to read very fast to Interbase???
>
> Simon
>