I am starting to look at the query optimizer in SQL server 2008 and I’m particularly interested in the statistics profile that can be shown for a query. So far i understand that the result shown for the statistics profile is based on the statistics stored in SQL server and not the results from executing the query (e.g., the ‘Rows’ column), right?
Now, is there a way to get the result from the statistics profile without executing the actual query at the same time?
SET STATISTICS_PROFILE ONreturns both actual and estimated row counts.If you want just estimated row counts without running the query use
SET SHOWPLAN_ALL ONorSET SHOWPLAN_XML ON