The query has been canceled because the estimated cost of this query () exceeds the configured threshold of 3000. Contact the system administrator.
QUERY_GOVERNOR_COST_LIMIT - Is a numeric or integer value specifying the longest 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.
For shared hosting, we need to guarantee all customers get a good performance when run applications, so we have to set QUERY_GOVERNOR_COST_LIMIT to 3000 by default.
And please note that your query estimated cost may be different on different SQL server versions. For example, SQL 2014 web and SQL 2019 web edition may show a different result. Normally, we always recommend our customers to create database on the latest version of SQL server.
Overrides the currently configured query governor cost limit value for the current connection. The below is an example that increases QUERY_GOVERNOR_COST_LIMIT to 6000. If your own query estimated cost is 14000, you will need to set below value larger than it. The setting of SET QUERY_GOVERNOR_COST_LIMIT is set at execute or run time and not at parse time. You need to run the query at the beginning of each query which needs to run over the threshold limit of 3000.
SET QUERY_GOVERNOR_COST_LIMIT 15000
ORDER BY FechaApunte DESC
Note: increasing the query governor cost is not a good solution, we would recommend paying more attention to your SQL statement and optimize it.
Article ID: 1505, Created: September 8, 2013 at 9:11 PM, Modified: April 19, 2021 at 11:15 PM