July 28, 2010 at 5:57 am
July 28, 2010 at 6:34 am
There's no way to tell that for certain. You can guess, based on the predicates in the query and the joins which ones will likely be used.
Or, if you have a test database somewhere, drop all the stats, run the query and then see which ones were created, but that won't help for index statistics.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 28, 2010 at 7:01 am
The statistics that were considered interesting to the query optimiser are stored with the compiled plan, but this information is not exposed to users.
The real question is, why do you want to know which statistics are relevant to a query compilation?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply