Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Tuning Advisor - Statement does not reference any tables

Tags:

sql-server

There's another question which references this same issue, but doesn't have any answers for this particular question:

I'm running the SQL Server Tuning Advisor and the Tuning Log is getting filled up with errors such as "Statement does not reference any tables" or "Event does not reference any tables". When I look into these statements, they are referencing views, variables, functions or stored procedures. Is there a way to filter out these types of errors? I don't consider a Select query referencing a view instead of a table to be a syntax error, and I'd like to improve the signal-to-noise of this log.

For reference, I've set the Profiler trace to record data using the "Tuning" template. The trace file is about 900MB, and I'm getting recommendations for tuning, so that's not an issue.

like image 269
Kevin Pope Avatar asked Mar 16 '26 18:03

Kevin Pope


1 Answers

Database Engine Tuning Advisor parses events in supplied workload and tunes the statements that are associated with the event. Events that cannot be tuned produce messages which are written to tuning log but this don't stop a tuning session. Tuning Advisor can tune an event only if a Showplan output is produced by the server for that event, in the database where the event was executed.There can be many reasons why events are not tuned as explained in article:

http://technet.microsoft.com/en-us/library/ms179380(v=sql.100).aspx

Tuning log message: S001 - Statement does not reference any tables and S008 - Event does not reference any tables are such an example. These are event-level messages, so the Statement column of the tuning log for them is empty.

like image 96
Deepshikha Avatar answered Mar 21 '26 10:03

Deepshikha