Subject Re: [IBO] Re: Speed difference between TIBQuery and TIB_Query?
Author Helen Borrie
Steve,

At 06:00 PM 22/05/2004 +0000, you wrote:
>Gee. I don't know what else to tell you so I'll just post some code.

In this case, it was the only way to find out what your program was really
doing.

The first comment is - it's astonishing that you are using the client to do
this non-interactive processing in a client/server system.

Next, if you must do it in the client, DON'T USE SCROLLABLE DATASETS. The
IB_Query is not the thin, lifeless creature that the IBX TIBQuery is: it
carries a lot of cargo to make interactive applications work well and
safely and it's totally unsuitable for this type of utility. Some of this
processing (if you must!) should be done with IB_Cursor, some with IB_DSQL.

Third, there are places in this routine where you are consuming huge
amounts of resource totally unnecessarily. Are you aware at all of the
benefits of using prepared statements and substitutable parameters, or
would you like that explained?

Fourth, there is the huge cost of pulling a previously unprepared dataset
across the wire each time you perform the same iterative (not recursive,
that's something different) action. That isn't cool in a client/server
system.

At this point, there are some starters for discussion...study the props and
methods of tib_dsql and tib_cursor if you want to beat this down to your
ideal of around TWO MINUTES and retain your ponderous desktop application
architecture. If you want it to be subsecond, go for an executable SP that
takes an input parameter or two and does the whole operation by calling
other SPs, all server-side.

Sorry if I seem ultra-negative - I don't mean to be - using a client/server
system effectively is much more than converting your desktop code. IBO for
C/S is a sweet ride. I see only legacy-Paradox (legacy-Access?) in your
treatment. Render unto the desktop that which is the desktop's. If you
want performance, get into the "client/server groove".

Helen