Press "Enter" to skip to content

DDL And The Optimizer

Grant Fritchey notes that data definition language (DDL) queries do not appear to go through the query optimizer:

We can check whether or not you’re going to get an execution plan for this in two easy ways. You can capture the estimated plan, or run the query and capture the actual plan. Since most of the time, it’s preferable to work with the added runtime information that an actual plan provides, let’s start there. However, if you execute the query above and try to capture an actual plan, you will not get one. So, let’s capture the estimated plan instead. Here’s what we see:

Not much of a plan really.

Read on for that, and start holding your breath for a new execution plans book.