DB2 REXX SQL for VM/ESA(R): Installation and Reference


Appendix G. Performance and Diagnosis

The first section of this appendix covers some of the common errors and performance concerns that users have. The second section is a list of hints and tips provided to help you diagnose a problem.

This is not intended to be a comprehensive discussion on either performance or diagnosis, because RXSQL is merely an interface between REXX and the database manager. There are many factors that can contribute to the performance of your programs, or to errors in your programs. This discussion just highlights some of the more common pitfalls.

If you have a hint or a tip that you feel should be in this appendix please send it in to IBM on the Readers' Comment Form at the back of the manual. IBM is committed to providing you with quality documentation, and welcomes any suggestions you have. IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you.


Performance

Performance Improvement After Testing

You can turn off the setting and resetting of a group of RXSQL variables to improve an application's performance, after you finish testing it. Before setting the LASTING GLOBALV variable (GLOBALV) described here, make sure that the application contains no programmed dependencies that will become incorrect with the changed settings of the RXSQL variables described in this section.

Use a GLOBALV variable to improve an application's performance. The GLOBALV variable, $$RXSQL32$$ in group SQL/DS,

is retrieved at the first invocation of a RXSQL command in an EXEC. If the variable exists and the first character of its value is Y or y, several RXSQL variables will not be set or reset at each RXSQL or EXECSQL invocation. Changing the value of $$RXSQL32$$ after the first RXSQL request in an EXEC has no effect until control is returned to CMS.

The GLOBALV variable can be set with the following CMS command:

   GLOBALV SELECT SQL/DS SETP $$RXSQL32$$ Y

When the above command is issued before the first RXSQL request in the EXEC, the affected RXSQL variables are:

Setting $$RXSQL32$$ as a GLOBALV variable continues to affect the execution of RXSQL applications because the variable remains in the logon session after the application terminates, unless it is explicitly cleared. To stop the effect of this variable on an EXEC, clear the GLOBALV variable using an appropriate GLOBALV CMS command before the first RXSQL request in the EXEC.

Hints and Tips

There are a few basic rules to follow when coding your programs for optimum performance.

  1. The performance of a program which uses RXSQL depends extensively on the design of the database and the efficiency of your SQL statements used to access and manipulate data in the database. This includes:

    As an application designer you often have to weigh the pros and cons of many design strategies and many factors including system considerations, database considerations, and object design. Subjects that will help you make these decisions include: Locking, normalization, DASD balancing, indexes, and access authorities. Both the DB2 Server for VSE & VM Application Programming manual and the DB2 Server for VSE & VM Database Administration manual will provide you with more information on these and other topics.

  2. Minimize the number of calls DB2 RXSQL must make to the database manager by minimizing the number of DB2 RXSQL requests executed in your programs.
  3. Minimize the number of calls DB2 RXSQL must make to CMS by minimizing the number of variable-names within your RXSQL statements. Each variable-name that needs resolution by DB2 RXSQL requires a call to a CMS interface. Where possible, let REXX resolve the values of variable-names before DB2 RXSQL is passed the request.
  4. Use variable-qualifiers so that RXSQL does not have to infer the data types.
  5. Ensure that data types are consistent from one insert to the next. If DB2 RXSQL infers a different data type from the execution of one PUT statement to the next, then DB2 RXSQL traps the error returned from the database manager, closes the cursor and re-opens it. This will affect the performance of your application. For example, if you insert the value 12 on one PUT statement, DB2 RXSQL will infer that the data type is integer. If the value on the next PUT statement is 12.07, then DB2 RXSQL will infer that the data type is decimal.
  6. Shorten the CMS command search path by using either Address COMMAND or the DB2 RXSQL subcommand environment. See Appendix I, RXSQL Subcommand Environment.


Diagnosis

Hints and Tips

In the following discussion, all SQLCODES and return codes mentioned are for DB2 Server for VM.

Common Error conditions:

Miscellaneous Tips



[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]