Sample Header Ad - 728x90

Why I don't see the OptimizerStatsUsage in the execution plan

1 vote
1 answer
95 views
SQL Server 2017 introduces a very helpful enhancement to the showplan to see which statistics were used to generate a plan: https://learn.microsoft.com/en-nz/archive/blogs/sql_server_team/sql-server-2017-showplan-enhancements However, I can't find it in my execution plan. I have the following query on the StackOverflow database:
Use StackOverflow2010;

DROP TABLE IF EXISTS #tempPosts;
CREATE TABLE #tempPosts(
	Id int
)

INSERT INTO #tempPosts
SELECT ID FROM dbo.Posts
WHERE OwnerUserId = 26837

SELECT Title, u.DisplayName, pt.Type FROM dbo.Posts p
INNER JOIN #tempPosts temp
ON p.Id = temp.Id
INNER JOIN dbo.Users u
ON p.OwnerUserId = u.Id
INNER JOIN dbo.PostTypes pt
ON p.PostTypeId = pt.Id
OPTION(RECOMPILE)
I turned on the Include Actual Execution Plan to capture the plan and could not find OptimizerStatsUsage field in the plan: execution plan that doesn't have OptimizerStatsUsage properties What could be the reason for OptimizerStatsUsage not showing up in my execution plan? Is there any additional configuration or step needed to see this property? Thank you for any insights!
Asked by Tuyen Nguyen (343 rep)
Nov 11, 2024, 10:04 PM
Last activity: Nov 12, 2024, 07:08 AM