Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

ERROR 8623 The query processor ran out of internal resources and could not produ ...

$
0
0

Question:In the SQL Server Error Logs I saw the following message:

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

Is there a way to find the query ? I know I can use something like Extended Events which would allow me to trap the sql text , but what about finding a query that has executed and triggered this error

Answer:If you don’t have the query , you can use some DMVs to extract large queries .The limitation is that the data from DMVs is refreshed after every SQL Server restart.

Here are some example queries utilitising DMVs which could assist you to track down the query .

SQL Server Find high impact queries with sys.dm_exec_query_stats

SQL Server Performance Top Queries by Total CPU Time

How to find Longest running queries in SQL Server

Look for queries with long IN lists, an unusually large number of UNIONS & nested sub queries. In my experience these have contributed a large percentage of the reason for these error messages.

On occasion , the root cause may be fixed by a the service pack upgrade.


Viewing all articles
Browse latest Browse all 3160

Latest Images

Trending Articles