Category: Performance

1

The Importance of First Column in Nonclustered Index

Does it matter which column is first in an Index? Yes it does, simply because using different columns can result in different execution plans.  Introduction Let’s consider the below select statement – first we will create an index named [IX_OrderDate_ProductKey] on OrderDate and ProductKey and then an index [IX_ProductKey_OrderDate] on ProductKey and OrderDate.

Comparing...

0

UNION vs UNION ALL

In this post, we will have a look at the differences between UNION and UNION ALL operators using Heap and Clustered Tables. For this illustration, I will use the Adventure Works DW database. UNION – By default UNION does a distinct select on the valuesUNION ALL – Allows the selection...

1

INSERT INTO vs SELECT INTO

Introduction What is faster to use… INSERT INTO or SELECT INTO? I have read many blog posts comparing INSERT INTO to SELECT INTO, yet so many still get it wrong. In this post, I will provide the full picture of performance differences between INSERT INTO and SELECT INTO and how...

2

INSERT INTO vs SELECT INTO (Detailed)

Into to Detailed Breakdown As mentioned in the previous main post, below is a detailed comparison between INSERT INTO & SELECT INTO from SQL Server 2012 up to 2017 using temporary tables. The Testing Scripts Used Below you can find the testing scripts which were executed on each version of...