query tuning

Home/Tag: query tuning

SQL Server Statistics Histogram- How to Decode? (Statistics Internals)

Hi Friends, Here is a short explanation of the SQL Server statistics histogram. I am using AdventureWorks2008R2 database. There is a table Sales.SalesOrderHeader with a column TotalDue. Let us have a look at that column. USE AdventureWorks2008R2 GO -- first observe the rows select TotalDue from Sales.SalesOrderHeader GO select DISTINCT TotalDue from Sales.SalesOrderHeader GO You [...]

SQL Server Dynamic Index seek operation

Hi Friends, Indexing is a wonderful thing. We all know about Index scans and seeks. Today I want to talk about SQL Server dynamic index seek operation. I find it tough to explain in words so I will straight away use an example without further ado ! Suppose you run the following query (turn on [...]