ODBC Server Installation and Management Manual

Managing NonStop ODBC Server Resources
HP NonStop ODBC Server Installation and Management Manual429395-002
5-17
Query Status Records
Governing policy:
GOV_NAME GOV_ATTRIBUTE LIMIT_VALUE GOV_ACTION QST_LOG_ON
Policy-A estimated_cost 500 priority --10 N
Policy-A estimated_cost 3000 priority --30 Y
Policy-A estimated_cost 5000 stop N
Policy-A elapsed_time 10 min. commit
Policy-A rows_accessed 10000 priority --30
When user SQL_ODBC logs on to the system, both scheduling and governing policies
are enforced according to the setting of Policy-A, and the user profile specifies not to
log status for every statement. After the statement has been prepared, because it has
an estimated cost of 1000, the statement is scheduled to run with a new priority of 140
(lowered by 10). This statement does not generate a query status record, because the
QST_LOG_ON flag is set to “N” for this cost range.
During the execution of this statement, if the elapsed time exceeds 10 minutes, the
query is stopped, and the transaction is committed. A message of “query stopped
because the elapsed time limit is exceeded” is returned to the client, as are the rows of
data fetched.
If 10,000 rows have been accessed in less than 10 minutes, priority is lowered by 30,
and the query is run with priority 110 until completion. A message of “priority for this
query has been changed to 110” is returned to the client. In this release, this governing
action can be applied to the query only once. No further limit is applied.
Query Status Records
The query status record can be used to manually monitor and manage a long-running
query. It provides information such as which statements are currently running, when
did the statement start, and who is running a particular statement. You can specify that
query status is to be logged by using the QST_LOG_ON attribute for user profiles and
governing policies.
In the case of governing runaway queries, by using the statement-started time in the
query status table, a user with the proper authority, or a user-supplied governing
process, would be able to stop the query by terminating the NonStop ODBC Server
process.
If resource accounting has been configured, after the query is completed, you can find
the query with more details logged in the ZNUMTRX metrics table, as described
previously for the resource accounting feature.
Query Status Table
There is one query status table, ZNUQST, that is active at any given time in a system.
The table location is specified by the QST_LOGTABLE_NAME attribute in the system
configuration table, which is built by the CREATE QST_LOG command.