My optimization rules of thumb for a slow running query: read the query plan first, turn scans into seeks, fix bookmark lookups with a covering index and more.
SQL SERVER – Converting Subqueries to Joins
Developers often write subqueries where Joins would do, or the other way around. A short note on converting between the two, with links to my earlier examples.
SQL SERVER – Join Better Performance – LEFT JOIN or NOT IN?
LEFT JOIN or NOT IN: which one gives Join Better Performance? It depends on the data. Compare the two queries and their execution plans on AdventureWorks.
Filtering on Dates Without Losing the Index
Filtering on dates without losing an index means using searchable ranges; learn half-open boundaries, date and datetime differences, and plan checks.
Reading the Warnings in an Execution Plan
Warnings in an execution plan can reveal conversions, missing statistics, and spills; read each warning in workload context.
SQL SERVER – 2005 – Mechanisms to Ensure Integrity and Consistency of Databases – Locking and Row Versioning
Books Online describes two mechanisms to ensure integrity and consistency of databases: locking and row versioning. Here is how it defines each one.
SQL SERVER – 2005 – Find Nth Highest Record from Database Table – Using Ranking Function ROW_NUMBER
Nicholas Paldino shared a neat way to find the Nth Highest Record from a table in SQL Server 2005 using the ranking function ROW_NUMBER. Here is his query.






