skip to main content
Designing and coding the IP : Update processing : Optimizing update processing
 

Optimizing update processing

Applications such as Microsoft Access can make use of version and/or unique row id to optimize UPDATE processing. Normally, Microsoft Access generates an UPDATE statement in which the WHERE clause contains equality conditions for all the values read for that row. It does this to make sure that no one else has changed the data between the time it was selected and the time that it is updated. This can be inefficient when many columns are involved.
But applications behave differently if the data source indicates that one of the columns in the table contains row version information. The row version field must be updated by the IP each time that row is modified. In this case, the WHERE clause of the UPDATE query only contains the columns that uniquely identify that row and contain the row version. You can identify any column in your tables as a row version field by marking the PSEUDO_COLUMN attribute as SQL_PC_PSEUDO and the OA_COLUMNTYPE attribute to SQL_ROWVER. Applications use the SQLSpecialColumns ODBC call to identify these columns.
Some applications use a column that is marked as a ROWID to achieve optimized inserts. In this case, the WHERE clause of the UPDATE statement contains the values for the column that is marked rowid and the values of the columns that are changing. You can identify any column in your tables as a rowid field by marking the PSEUDO_COLUMN attribute as SQL_PC_PSEUDO and the OA_COLUMNTYPE attribute to SQL_BEST_ROWID. Applications use the SQLSpecialColumns ODBC call to identify these columns.