Subject RE: [IBO] Slow Performance
Author Michael L. Horne
Hello Chris,

You could try writing a Stored Procedure. You would pass
the SP all the information from the ticket line and it
would do all the edit/inserts.

You could even have the SP retrieve the information from
the ticket line and then do the edit/insert.

Notes about what you are currently doing.

1. You should access your Ticket Line Item file with a TIB_Cursor.

2. You should have a separate TIB_Cursor or TIB_DSQL for each
edit/insert. They should be setup with parameters for each
field being changed. They should have INSERT/UPDATE SQL
defined based on what you are doing.

3. If most of your changes are updates, you could create a TIB_DSQL
with UPDATE SQL and after Execute it. Check the RowsAffected
if it is equal to zero then you need to do an INSERT, because
the record you are trying to update is not there

4. You also need to wrap the code that does the work between
.... code to do the work here
This will keep the windows cursor from flickering which can
eat up a lot of time.

All of these changes can make a big impact on the speed of
your program. Give them a try and see if they make it fast
enough, or if you need further help.

The biggest speed increase you can get is from using the SP.

Good Luck
Michael L. Horne

-----Original Message-----
From: Chris Hulsey [mailto:chulsey@...]
Sent: Wednesday, September 05, 2001 1:47 PM
Subject: [IBO] Slow Performance

Hello All,

I am developing an C++ Builder 5.0 application with IBO 3.6 that has to
update multiple sales tables from a ticket line item record. Unfortunately
there are about 100,000 ticket line items and there are about 7 different
sales tables with about 6 different time periods for each. Currently I have
a TIB_Database connection and TIB_Query to retrieve the Ticket line items
and a TIB_Query for my EDIT/INSERT of the different sales tables. Each
Ticket Line Item has the possibilty of doing about 40-42 EDIT/INSERT
operations. It takes 3 days to run this process which surely I am doing
something wrong here. Any suggestions as to how I can speed this process
up? It starts out at a slow speed but gets even slower as time passes?

Hardware Specifications
Windows 2000 Server
Pentium 4 (1.7 Ghz)
2GB of Memory
Interbase 6 running as Local Server

Chris Hulsey
Visible Changes, Inc