錯誤訊息
The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.根據這篇官方文章 FIX: Error message when you run a complex query after you install Cumulative Update 3 or Cumulative Update 4 for SQL Server 2005 Service Pack 2: "The query processor ran out of internal resources and could not produce a query plan" ,是說明 SP2 的 CU3 或 CU4 就已經修正,我們是 SP4 了,Orz
2009 年的 Connect 回報,The query processor ran out of internal resources and could not produce a query plan with WHERE in and several thousand values,根據官方回答,看來是要無解啦
後來詢問同事(就兩個人寫 ERP,很容易找出兇手,哈),同事有提到是用 UNION ALL 去串接資料產生這個錯誤訊息,發現後就馬上改掉 T-SQL 語法,雖然跟查到資料的方向都不太一樣,但看來這個 Error 應該是不會在出現才對
- 參考資料
- FIX: Error message when you run a complex query after you install Cumulative Update 3 or Cumulative Update 4 for SQL Server 2005 Service Pack 2: "The query processor ran out of internal resources and could not produce a query plan"
- The query processor ran out of internal resources and could not produce a query plan with WHERE in and several thousand values
- Using Server Trace to Identify 8623 Errors => 這篇提及是 IN (...) 太多參數造成的
沒有留言:
張貼留言