Re: Help on ESQL/C performance issue.
Posted in 1995
You clearly need one insert statement -- prepare it. You probably need only one delete statement -- prepare that too. Can you group the updates by the column which is to be updated? If so, you can prepare the update for each column, use it for all the relevant rows, and then free it and move onto the next set of updates for the same column. If not, I hope you are using ESQL/C 5.00 or later; you can then use string named cursors (probably based on the column name) to prepare the whole set of update cursors as you need each one, and then use the relevant one each time. So, use PREPARE for everything, but try to optimize the number of prepares. It should be N+2 where N is the number of columns in the table -- at most. In general, Informix code works best with prepared statements; your speed penalty will be negative -- a speed benefit, in other words. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: Joe Archer <mis@firstpac.com> >Date: 27 Oct 1995 21:54:52 GMT >X-Informix-List-Id: <news.18344> > >I am about to write a large batch application in ESQL/C. I >would like to know if anyone knows if there is any performance >degredation by implementing an application using dynamic SQL. >This application performs a whole bunch or insert, update, and >deletes. Each update will be for one random column, for one >random row. Each delete will be for one random row. Each >insert will update all columns for the row. > >I don't want to prepare a whole bunch of adds, updates, and >deletes, 'cause I'm afraid that it will be a big hairy mess! >But, I don't want this batch to be a real dog either, it HAS to >be very fast. So, I'm trying to determine what the penalty is >going to be for using dynamic SQL.