The query has been canceled, because the estimated cost of this query exceeds the configured threshold. Contact the system administrator

Microsoft.SQLServer.2012.The_query_has_been_canceled_because_the_estimated_cost_of_this_query_exceeds_the_configured_threshold._Contact_the_system_administrator_1_5_Rule (Rule)

Knowledge Base article:

Summary

The configuration setting for the query governor cost limit option is lower than the cost that the SQL Server optimizer estimated for the specified query. By default, the query governor cost limit option is set to 0, which allows all queries to run. However, on this instance of SQL Server an upper limit was specified by setting the option to a number greater than 0. Query plans with an anticipated cost larger than this value are not started.

For more information, see “query governor cost limit Option”, “How to set the query governor cost limit option (Enterprise Manager)”, and “Query Tuning Recommendations” in Books Online.

Resolutions

Any of the following actions will prevent the message from occurring for this query:

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Priority

Defines Alert Priority.

1

Severity

Defines Alert Severity.

1

Element properties:

TargetMicrosoft.SQLServer.2012.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID8649
Event Source$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
The query has been canceled, because the estimated cost of this query exceeds the configured threshold. Contact the system administrator
{0}
Event LogApplication
CommentMom2012ID='{74138FB8-4CBA-480B-82D1-C5456A38AA4A}';MOM2012GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.Windows.EventProvider Microsoft.SQLServer.SQLDefaultAccount
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2012.The_query_has_been_canceled_because_the_estimated_cost_of_this_query_exceeds_the_configured_threshold._Contact_the_system_administrator_1_5_Rule" Target="SQL2012Core!Microsoft.SQLServer.2012.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2012ID='{74138FB8-4CBA-480B-82D1-C5456A38AA4A}';MOM2012GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Windows!Microsoft.Windows.EventProvider" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>8649</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2012.The_query_has_been_canceled_because_the_estimated_cost_of_this_query_exceeds_the_configured_threshold._Contact_the_system_administrator_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>