Profiling

The database driver allows users to log timing and statistics information. This is useful for tuning because the information may help to identify performance bottlenecks and can give input into the tuning process.

The database driver’s profiling option provides a method to gather the timing of SQL statements that are being executed. Logging all statements with their timings, results in a large log file that cannot be easily analyzed.

Define a logging threshold where only statements that take more than a given amount of time to complete are logged.

With profiling, this information is logged:

  • RDBMS request
  • Elapsed time
  • User name
  • Date
  • Time

The maximum precision that can be specified is one hundredth of a second.

Set the MSQLPROF environment variable to a time threshold (in seconds), to determine which table actions are most time consuming. For example, specify MSQLPROF as:

SET MSQLPROF=1.0

This sets MSQLPROF to one second. Statements that take more than 1.0 seconds of elapsed time to complete are logged to the MSQLPROF file in the directory %BSE%\tmp.

Statement execution time can be viewed for individual tables by setting the MSQLPROF environment variable. For more information about the environment variables, see "Driver resources and environment variables".