Execution Plans I: setup

In this post I will explain how to create executionplans from production on your developers laptop for SQLserver:

(1) download and install the SQLManagement Studio snap-in plan explorer from SentryOne

(2) Export databaseobjects including statistics and histograms from production as follows:

Generate DB objects
Press the Advanced Button
switch on Script Statistics and Histograms

(3) Create the database on your laptop and make sure to switch off any statistics creations in the properties:

(4) Copy parallel processing configuration parameters from production:

sp_configure ‘cost threshold for parallelism’ , x
sp_configure ‘max degree of parallelism’, x

You are now ready to check the executionplans of your new SQL statements your new environment. If you look at the tablesizes ( with this query ) you will see that your new tables are have the statistics in place, but all tables are really empty:

Example from AdventureWorks Database

In the next post we’ll have a look at the executionplans.

Leave a Reply

Your email address will not be published.