Blog Pages

Limit the time for a query to be executed

Use the QUERY_GOVERNOR_COST_LIMIT option to specify an upper limit for the time in which a query can run. Query cost refers to the estimated elapsed time, in seconds, required to complete a query on a specific hardware configuration

SET QUERY_GOVERNOR_COST_LIMIT value -- value in seconds

Notes:
  • Specifying 0 turns off this option.
  • The definition of QUERY_GOVERNOR_COST_LIMIT applies to the specific connection only.
  • If the estimated cost of the query exceeds the configured threshold - the query will be failed with an error message:
The query has been canceled because the estimated cost of this query (x) exceeds the configured threshold of 20. Contact the system administrator.

No comments:

Post a Comment