Chapter 11. Points to Consider While Writing Queries

In this chapter we will cover:

  • Improving performance by limiting the number of columns and rows
  • Improving performance by using sargable conditions
  • Using arithmetic operators wisely in predicate, to improve performance
  • Improving query performance by not using functions on predicate columns
  • Improving performance by Declarative Referential Integrity (DRI)
  • Trust your foreign key to gain performance

Introduction

Prevention is always better than cure is what I believe. It's a good idea to have a look at some safeguards so that common mistakes don't happen in the TSQL we write, which can cause performance issues later on. There are so many things to consider, to avoid common programming mistakes. Here, we ...

Get Microsoft SQL Server 2012 Performance Tuning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.