Why was a query plan not collected?
SQL Sentry employs a sophisticated algorithm to match cached execution plans from SQL Server to Top SQL events. This article discusses some more common reasons for not discovering a match for a given batch or statement.

SQL is dynamic
Because EXEC (‘tsql string’) and sp execute SQL do not compile a query until after it has been completed, the only method to retrieve the plan for the call is to get the plan handle while it is ongoing. Because the default polling time is 5 seconds, it may not capture a project if the dynamic SQL query runs faster.
Batches with Multiple Statements
In some circumstances, utilizing the SET SHOWPLAN XML ON set option is the only way to retrieve a plan. We don’t try to capture projects using this way if the batch has more than one statement to avoid plan cache bloat. As a result, if the collection executes a large number of words quickly, the chances of capturing a plan are minimal for the same reasons as Dynamic SQL.
Errors that match
The plan analysis can sometimes fail, and this can be traced to race circumstances within the DMVs, which result in bad data points for the study. DMVs such as dm exec requests and dm exec query stats pull data from numerous SQL Server sources. As a result, the information contained inside them is not necessarily consistent across all sources. These discrepancies will result in the abovementioned issues, preventing a plan from being matched to a Top SQL event.
Stored Procedures with Encryption
Encrypted stored procedures do not return query plans with valuable data. It is because query plans display statements; if encrypted programs depicted statements, the goal of encryption, which is to conceal them, would be defeated.
System Stored Procedures are not available.
Some system stored procedures are secret, which can cause issues on occasion. We can acquire the query plan if we capture the actual handle while the statement is running. Still, sometimes the object or plan lookup will return results that don’t point to genuine plan information.
Plans That Aren’t Important
Some plans are simple and contain statements that don’t generate plan data. The following sentence, for example, will never create a query plan:
IF (1 = 1)
WAITFOR DELAY '00:00:10'
If you think you’re having trouble, try the following steps:
add key="useTextBasedQueryPlanFunction" value="true"
Find the file “SQLSentryServer.exe.config” in the SQL Sentry Monitoring Service’s install directory. Use any text editor to find the XML element for “app settings” in this file. Copy the existing format of other settings, including any opening and closing tags, and add the following key between the opening and closing tags for “app settings”:
Restart your SQL Sentry Monitoring Service after saving the file.
Enabled Optimize For Ad Hoc Workloads
Because SQL Sentry collects plans from the SQL Server plan cache, this is the case. Ad hoc plans are not cached until they have been utilized more than once when “optimize for ad hoc workloads” is enabled. Instead, a plan stub is kept to see if the plan is ever needed again.
There will be no plan to capture if nothing other than a plan stub is kept for execution, and SQL Sentry cannot match the SQL event with a plan.
About Enteros
IT organizations routinely spend days and weeks troubleshooting production database performance issues across multitudes of critical business systems. Fast and reliable resolution of database performance problems by Enteros enables businesses to generate and save millions of direct revenue, minimize waste of employees’ productivity, reduce the number of licenses, servers, and cloud resources and maximize the productivity of the application, database, and IT operations teams.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Revolutionizing the Fashion Sector: How Enteros Leverages Generative AI and AI Performance Management to Optimize SaaS Database Efficiency
- 5 November 2025
- Database Performance Management
Introduction The global fashion industry has always been a beacon of creativity, speed, and transformation. From runway collections to e-commerce platforms, the sector thrives on rapid innovation and data-driven decision-making. In today’s digital-first world, fashion enterprises—from luxury retailers to fast-fashion brands—are evolving into technology-driven organizations, heavily dependent on SaaS platforms, AI tools, and cloud databases … Continue reading “Revolutionizing the Fashion Sector: How Enteros Leverages Generative AI and AI Performance Management to Optimize SaaS Database Efficiency”
Driving Financial Sector RevOps Efficiency: How Enteros Unites Database Performance Optimization and Cloud FinOps Intelligence
Introduction In the fast-evolving financial sector, success hinges on agility, precision, and performance. Financial institutions—banks, investment firms, fintech innovators, and insurance providers—depend on massive volumes of transactional and analytical data processed across complex, distributed systems. Yet, as these organizations modernize operations through cloud computing, AI, and automation, new challenges have emerged: escalating cloud costs, unpredictable … Continue reading “Driving Financial Sector RevOps Efficiency: How Enteros Unites Database Performance Optimization and Cloud FinOps Intelligence”
Empowering the Cloud Center of Excellence: How Enteros Uses Generative AI for Real-Time Monitoring and Performance Optimization in the Technology Sector
- 4 November 2025
- Database Performance Management
Introduction In the era of digital transformation, the technology sector stands at the forefront of innovation, harnessing cloud computing, artificial intelligence, and big data to drive performance and efficiency. However, as cloud infrastructures scale in size and complexity, managing performance, resource allocation, and cost optimization becomes increasingly challenging. Enter the Cloud Center of Excellence (CCoE) … Continue reading “Empowering the Cloud Center of Excellence: How Enteros Uses Generative AI for Real-Time Monitoring and Performance Optimization in the Technology Sector”
AI SQL Meets Healthcare Innovation: Enteros’ Breakthrough in Database Performance Optimization
Introduction In the modern healthcare landscape, data has become both a vital asset and a formidable challenge. Hospitals, research institutions, and digital health startups generate and process massive amounts of data—from patient records and clinical trial results to real-time monitoring devices and medical imaging. Yet, the performance of these complex data ecosystems often determines how … Continue reading “AI SQL Meets Healthcare Innovation: Enteros’ Breakthrough in Database Performance Optimization”