Sets limits to restrict the output generated by a query.
The mechanism used to set these limits is called the query
governor. The following gives you three ways to set limits using
the query governor:
o ROWS rows_value
You can restrict output by limiting the number of rows a query
can return. The optimizer counts each row returned by the
query and stops execution when the row limit is reached.
The default is an unlimited number of row fetches. Dynamic SQL
defaults are inherited from the compilation qualifier for the
module.
o TIME time_value [ SECONDS | MINUTES ]
You can restrict the amount of time used to optimize a query
for execution. If the query is not optimized and prepared for
execution before the total elapsed time limit is reached, an
error message is returned.
The default is unlimited time for the query compilation. If
you omit the SECONDS and MINUTES keyword then SECONDS is the
default.
NOTE
Specifying a query time limit can cause application
failure in certain circumstances. For instance, an
application that runs successfully during off-peak hours
may fail when run during peak hours due to the load on
the database.
o CPU TIME time_value [ SECONDS | MINUTES ]
You can restrict the amount of CPU time used to optimize
a query for execution. If the query is not optimized and
prepared for execution before the CPU time limit is reached,
an error message is returned.
The default is unlimited CPU time for the query compilation.
If you omit SECONDS and MINUTES keyword then SECONDS is
the default. Dynamic SQL options are inherited from the
compilation qualifier for the module.
Use a positive integer for the number of rows and the number of
seconds; negative integers are invalid and zero means no limits.
If an established limit is exceeded, the query is canceled and
an error message is displayed. When you set both a time limit and
the row limit, whichever value is reached first stops the output.
Application developers can use this feature to prevent users from
overloading the system. The database administrator can manage
system performance and reduce unnecessary resource usage by
setting option limits.