SQL SERVER – Identifying Statistics Used by Query

“Can I know which statistics were used by my query?”

Recently, someone asked this question in my training class of query optimization and performance tuning. I really liked the question. The answer for me is very simple.

“No.”

Well, if I stop here suggesting only “No,” it will be an incomplete answer. Let us continue a bit more. There is no direct method or DVM or any tool which can tell us which statistics were used by any query. In fact, it looks like there is no way one can know if the any created statistics was ever used or not.

The indirect way of knowing this is if one knows which index was used, then one can think the statistics which was created automatically when the index was created may be is used.

I would like to open this question to all of you and ask if you know any method using which one can identify which statistics was used when the query was executed.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Scripts
Previous Post
SQLAuthority News – SQL Server Quickstart Downloads from Microsoft
Next Post
SQL SERVER – SELECT * FROM dual – Dual Equivalent

Related Posts

Leave a Reply