Defrag your database!

A great tool to check the defragmentation of your database is Defraggler.

When you analyze your drive, it will show the number of fragments per file (as shown below) and you’re able to only defragment the database instead of the entire hard disk!

Advertisements

Filter out NULL values in Indexes

Received a great tip from my colleague on how to filter out NULL values in Indexes.

How to use a WHERE-clause within an Index? Well take a look!

CREATE NONCLUSTERED INDEX [IX_NC_ColumnName] ON [dbo].[TableName]
(
ColumnName ASC

)
WHERE ColumnName IS NOT NULL
WITH ...