One of my clients uses a commercial application and he has performance issues with some of the queries. As I already manage his other databases, he asks me if I can take a look at it.

The problem is that I can't modify the faulty queries.

We have several possibilities to optimize a query without modifying it.

In this article, I will introduce the "Plan Guide" with for two scenarios :

  1. To enable a trace trace flag to a specific query;
  2. To optimize a query by forcing SQL to recompile it.