SQL SERVER – Introduction to Force Index Query Hints – Index Hint

This article, I will start with disclaimer instead of having it at the end of article. “SQL Server query optimizer selects the best execution plan for a query, it is recommended to use query hints by experienced developers and database administrators in case of special circumstances.” When any query is…
Read More

SQL SERVER – Observation – Effect of Clustered Index over Nonclustered Index

Today I came across very interesting observation while I was working on query optimization. Let us run the example first. Make sure to to enable Execution Plan (Using CTRL + M) before running comparison queries. USE [AdventureWorks] GO /* */ CREATE TABLE [dbo].[MyTable]( [ID] [int] NOT NULL, [First] [nchar](10) NULL,…
Read More

SQL SERVER – FIX : ERROR : Msg 5834, Level 16, State 1, Line 1 The affinity mask specified conflicts with the IO affinity mask specified. Use the override option to force this configuration

Yesterday I came across following error while enabling fill factor for my database server, when I was trying to write article SQL SERVER – 2008 – 2005 – Rebuild Every Index of All Tables of Database – Rebuild Index with FillFactor. I ran following T-SQL script and it gave me…
Read More

SQL SERVER – 2008 – 2005 – Rebuild Every Index of All Tables of Database – Rebuild Index with FillFactor

I just wrote down following script very quickly for one of the project which I am working on. The requirement of the project was that every index existed in database should be rebuilt with fillfactor of  80. One common question I receive why fillfactor 80, answer is I just think…
Read More