Archive for category: SQL Optimisation

SQL Server TOP statement, Table Scans and Locks

21 Feb
February 21, 2012

This post describes an interesting situation were SQL Server locking might occur on a table that has not been indexed carefully, and how you can resolve this issue.

Read more →

SQL Server Table Variable vs Temporary Table vs CTE

12 Jan
January 12, 2012

Breaking SQL queries up into temporary physical or virtual “units” is done for many reasons, including performing complex SQL logic, re-using data for multiple DML/ETL operations (for example, multiple INSERTs), or simply just for better SQL code readability/maintainability.

This posts discusses the 3 available options in SQL Server for holding temporary data, these are SQL Table Variable, SQL Temporary Table and the CTE (Common Table Expression) SQL Syntax

Read more →

SQL Server CXPACKET Wait Type

07 Jan
January 7, 2012

In this post I will go through the SQL Server Wait Type CXPACKET, what is this wait type a symptom of, and how you could go about diagnosing and optimizing the CXPACKET wait type.

Read more →

SQL Server Graphical Execution Plan Icons Walkthrough Part 1 – Lookup Operations

26 Jun
June 26, 2011

SQL Server’s Graphical Execution Plan contains a wealth of information that could be used to diagnose performance and maintenance (such as out of date statistics) issues.

Read more →