Subject Re: [IBO] Newbie Question -- Inserts slow?
Author Jason Frey
> I would have to guess it is because of the session busy cursor. IBX
doesn't
> use a screen cursor (SQL hourglass) but IBO does. If you don't bracket
long
> running jobs (that have lots of iterations) in a BeginBusy/EndBusy block
you
> will get needless hourglass flicker going on.
>
> Wrap your code something like this:
>
> MyDSQL.BeginBusy( false );
> try
> ...
> finally
> MyDSQL.EndBusy;
> end;
>
> Please let me know if this makes a difference. It is so second hand to me
> now to do this that I forget to think others are not doing likewise.

I had disabled the cursor flashing altogether with the
SessionProps.UseCursor... I hate cursors doing stuff when I didn't tell
them to. :) Anyways, my previous tests were run that way.
I wrapped up stuff in the try finally as well, like you suggested, and it
did seem to make a difference (an increase of a few thousand records more a
minute).

> Making sure the IBO transaction isn't in AutoCommit = true would be
another
> check. No point in doing a commit for each record (unless you are required
> to).

Especially when I'm already handling commits myself, I agree. :)
It was already set to false for the tests I ran.

> PS. I thought you were using a TIB_Script to start with and I wasn't
talking
> about any optimizations but rather my parser being potentially more
> computationally intensive than the IBX's script equivalent.

Ok..
To clarify, I used the IBSQL component from IBX (The thing that looks like a
little lightning bolt on the component pallette).
I'm now using, thanks to a poke from Daniel Rail, the IB_DSQL component.
I think these are the most functinally equivalant counterparts to each
other.
I'm not sure that IBX even has a script component of it's own, to tell you
the truth. :)

As for preparing the query (To combine two email responses into one), I'll
take a look after I get some "real" work done (IE what my boss wants me to
do. :)). As it stands now, explicitly preparing the query does not do me a
whole lot of good, as the SQL is changing because every line is different.
I'll need to write it to using parameters, so I only have to prepare it
once.
Although, I've found that using parameters (On some database platforms, IE
SQLServer using ODBC) is slower than embedding the data in the SQL. I will
give it a shot, and see how it goes.

- Jason