Subject | Newbie Question -- Inserts slow? |
---|---|
Author | polydwarf820 |
Post date | 2002-06-07T19:20:47Z |
I'm checking out IBObjects (Coming from an IBX background).
A simple test app I have to test relative speed is failing miserably
using IBObjects (At least, as compared to IBX). My guess is that I
just have something set up wrong. :)
Anyways, it runs an external script file, which just contains a mass
of inserts, of the form:
insert into temp values ('86147','136.1','136.1');
insert into temp values ('86147','279.4','279.4');
insert into temp values ('86147','283.0','283.0');
insert into temp values ('86147','287.3','287.3');
insert into temp values ('86147','287.4','287.4');
Using IBX, my app inserts on the order of 240,000 records a minute.
Using IBO, it inserts something like 30,000 records a minute.
What I have set up for IBO (Written in Delphi):
1. A TIB_Connection, with default parameters (Aside from database
location/name and user/pass stuff).
2. A TIB_Transaction, with default parameters (Aside from
IB_Connection)
3. A TIB_Cursor, with default parameters (Aside from IB_Connection
and IB_Transaction).
You click a button, you pick a file from the dialog. The file is
written so each line is it's own query. I just read off a line,
stuff it into the cursor's.SQL property, call an ExecSQL, read the
next line, stuff it in the cursor's.SQL property, etc.
Odd things I've seen :
1. The speed difference.
1a. If I have the transaction CommitRetaining after each insert, my
application's processor usage hovers around 30 percent or so of my
CPU, however only inserts about 12000 records a minute. If I have
the transaction CommitRetaining after every 15000 inserts, my
application's processor usage hovers around 50 percent (IBServer
doesn't really change throughout the runs), but I get the 30,000
records a minute listed above.
I'm running on FB 1.0, WindowsXP Pro, forced writes enabled.
My guess is I have something wrong/am using the wrong
components/something, as IBO is supposed to be at least around the
same performance as IBX, I thought, if not faster.
Can anyone shed light on what I might be doing wrong?
- Jason
A simple test app I have to test relative speed is failing miserably
using IBObjects (At least, as compared to IBX). My guess is that I
just have something set up wrong. :)
Anyways, it runs an external script file, which just contains a mass
of inserts, of the form:
insert into temp values ('86147','136.1','136.1');
insert into temp values ('86147','279.4','279.4');
insert into temp values ('86147','283.0','283.0');
insert into temp values ('86147','287.3','287.3');
insert into temp values ('86147','287.4','287.4');
Using IBX, my app inserts on the order of 240,000 records a minute.
Using IBO, it inserts something like 30,000 records a minute.
What I have set up for IBO (Written in Delphi):
1. A TIB_Connection, with default parameters (Aside from database
location/name and user/pass stuff).
2. A TIB_Transaction, with default parameters (Aside from
IB_Connection)
3. A TIB_Cursor, with default parameters (Aside from IB_Connection
and IB_Transaction).
You click a button, you pick a file from the dialog. The file is
written so each line is it's own query. I just read off a line,
stuff it into the cursor's.SQL property, call an ExecSQL, read the
next line, stuff it in the cursor's.SQL property, etc.
Odd things I've seen :
1. The speed difference.
1a. If I have the transaction CommitRetaining after each insert, my
application's processor usage hovers around 30 percent or so of my
CPU, however only inserts about 12000 records a minute. If I have
the transaction CommitRetaining after every 15000 inserts, my
application's processor usage hovers around 50 percent (IBServer
doesn't really change throughout the runs), but I get the 30,000
records a minute listed above.
I'm running on FB 1.0, WindowsXP Pro, forced writes enabled.
My guess is I have something wrong/am using the wrong
components/something, as IBO is supposed to be at least around the
same performance as IBX, I thought, if not faster.
Can anyone shed light on what I might be doing wrong?
- Jason