MSSQL 2014: 查詢已取消,因為此查詢的預估成本超出設定的臨界值。請連絡系統管理員

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

查詢管理員成本限制選項的組態設定,低於 SQL Server 最佳化工具為指定查詢所預估的成本。查詢管理員成本限制選項預設為 0,表示允許執行所有查詢。但在此 SQL Server 執行個體上,已將此選項設為大於 0 的數目,指定了上限。預期成本大於此值的查詢計畫,將不會啟動。

Knowledge Base article:

摘要

查詢管理者成本限制選項的組態設定低於 SQL Server 最佳化程式針對指定查詢所預估的成本。查詢管理者成本限制選項預設會設為 0,允許執行所有查詢。不過在這個 SQL Server 執行個體上,已將選項設為大於 0 的數字來指定上限。預期成本大於此值的查詢計畫不會啟動。

如需詳細資訊,請參閱《線上叢書》中的<查詢管理員成本限制選項>、<如何設定查詢管理員成本限制選項 (Enterprise Manager)>及<查詢微調建議>。

解決方式

下列任何動作之一都可避免對此查詢出現該訊息:

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

1

Element properties:

TargetMicrosoft.SQLServer.2014.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID8649
Event Source$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2014: 查詢已取消,因為此查詢的預估成本超出設定的臨界值。請連絡系統管理員
{0}
Event LogApplication
CommentMom2014ID='{74138FB8-4CBA-480B-82D1-C5456A38AA4A}';MOM2014GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2014.The_query_has_been_canceled_because_the_estimated_cost_of_this_query_exceeds_the_configured_threshold._Contact_the_system_administrator_1_5_Rule" Target="SQL2014Core!Microsoft.SQLServer.2014.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2014ID='{74138FB8-4CBA-480B-82D1-C5456A38AA4A}';MOM2014GroupID={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">
<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="SQL2014Core!Microsoft.SQLServer.2014.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.2014.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>