DBAs from the client’s organization ended up an argument about how T-SQL works. The discussion was about the epic confusion about TOP and DISTINCT.
Performance Challenge – Write Efficient Query – SQL in Sixty Seconds #140
Recently while working with my client I ended up in a very interesting situation where my client wanted me to write an Efficient Query.
Arrow in Execution Plan – SQL in Sixty Seconds #136
Do you know what a single arrow means in an execution plan? While we popularly call it the arrow, there is a technical name for these little arrows.
Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM
To add columns with NULL in SQL Server, first decide what an empty value means. This post sums three nullable columns with the plus operator, ISNULL, COALESCE and SUM, shows where each one differs on a row of all NULLs, and compares their CPU cost on two million rows.
Performance Comparison – IN vs BETWEEN – SQL in Sixty Seconds #127
Yesterday I blogged about SQL SERVER – Performance Comparison – BETWEEN, IN, and Operators. Following that, I got many emails about the topic.
BETWEEN vs IN in SQL Server: Which One Reads Less?
BETWEEN vs IN looks like a style choice, and it is not. This post builds a demo table and measures BETWEEN, the two operators and an IN list with and without an index. It shows that BETWEEN and the operators share one plan, that IN seeks once for every value and that sparse values change the question.
Single Column Single Row and TABLE SCAN – SQL in Sixty Seconds #111
Can a single column and single row result do an entire table scan? I recently got this question in my Comprehensive Database Performance Health Check.







