Overuse of Common Table Expressions

Let’s explore common table expressions.  Like we have shown with scalar-valued functions, the CTE may be useful, but can quickly hinder performance if not used responsibly. What is a CTE? Microsoft’s definition of a CTE: Specifies a temporary named result set, known as a common table expression (CTE). This is derived from a simple query and Read more about Overuse of Common Table Expressions[…]

Taking advantage of Sargability

You’ve read about Scalar-Valued functions and their RBAR(row by agonizing row) cost. You’ve also read about how combining recordsets can be costly. Now, we are going to discuss SARGability and how avoid statements that take the fun out of the seek. Searching! Seek and Destroy! Ok, so we’re not going to seek and destroy, but Read more about Taking advantage of Sargability[…]

Scalar Value and Built-In Functions

Throughout my career, it has become my strong opinion that the majority of performance problems are self-inflicted due to databases design or coding that is less than optimal.  This series will address common coding malpractice and the ways to mitigate them. I once heard that there are 3 types of developers in the IT world; Read more about Scalar Value and Built-In Functions[…]