Testing performance with the query governor

You can use the query governor to test the performance of your queries:

  1. Set the query time limit to zero ( QRYTIMLMT(0) ) using the CHGQRYA command. This forces an inquiry message from the governor stating that the estimated time to run the query exceeds the query time limit.
  2. Prompt for message help on the inquiry message and find the same information that you would find by running the PRTSQLINF (Print SQL Information) command.

The query governor lets you optimize performance without having to run through several iterations of the query.

Additionally, if the query is canceled, the query optimizer evaluates the access plan and sends the optimizer tuning messages to the joblog. This occurs even if the job is not in debug mode. You can then review the optimizer tuning messages in the joblog to see if additional tuning is needed to obtain optimal query performance. This reduces the use of system resources because the actual query of the data is never actually done. If the tables to be queried contain a large number of rows, this represents a significant savings in system resources.

Be careful when you use this technique for performance testing, because all query requests will be stopped before they are run. This is especially important for a query that cannot be implemented in a single query step. For these types of queries, separate multiple query requests are issued, and then their results are accumulated before returning the final results. Stopping the query in one of these intermediate steps gives you only the performance information that relates to that intermediate step, and not for the entire query.


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