查詢管理員成本限制選項的組態設定,低於 SQL Server 最佳化工具為指定查詢所預估的成本。查詢管理員成本限制選項預設為 0,表示允許執行所有查詢。但在此 SQL Server 執行個體上,已將此選項設為大於 0 的數目,指定了上限。預期成本大於此值的查詢計畫,將不會啟動。
查詢管理者成本限制選項的組態設定低於 SQL Server 最佳化程式針對指定查詢所預估的成本。查詢管理者成本限制選項預設會設為 0,允許執行所有查詢。不過在這個 SQL Server 執行個體上,已將選項設為大於 0 的數字來指定上限。預期成本大於此值的查詢計畫不會啟動。
如需詳細資訊,請參閱《線上叢書》中的<查詢管理員成本限制選項>、<如何設定查詢管理員成本限制選項 (Enterprise Manager)>及<查詢微調建議>。
下列任何動作之一都可避免對此查詢出現該訊息:
調整查詢以將預估的執行時間,降到限制值以下。
確認查詢參考的資料表與索引上的統計資料是最新的。您可能需要執行 UPDATE STATISTICS 或 DBCC DBREINDEX。
將 [查詢管理員成本限制] 選項重設回預設值 0。這樣便可讓所有查詢執行。
將 [查詢管理員成本限制] 選項增加為高於執行此查詢所需的估計秒數。
名稱 | 描述 | 預設值 |
已啟用 | 啟用或停用該工作流程。 | 是 |
優先順序 | 定義警示優先順序。 | 1 |
嚴重性 | 定義警示嚴重性。 | 1 |
Target | Microsoft.SQLServer.2014.DBEngine | ||
Category | EventCollection | ||
Enabled | True | ||
Event_ID | 8649 | ||
Event Source | $Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ServiceName$ | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Remotable | True | ||
Alert Message |
| ||
Event Log | Application | ||
Comment | Mom2014ID='{74138FB8-4CBA-480B-82D1-C5456A38AA4A}';MOM2014GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74} |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ | DataSource | Microsoft.Windows.EventProvider | Default |
GenerateAlert | WriteAction | System.Health.GenerateAlert | Default |
<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>