HOW TO: Recreate SQL Server Statistics In a Different Environment

how to recreate sql server statistics in a different environment

Did you know table and index statistics are the most important piece of metadata for your database? The reason for this has to do with how SQL Server (and other database engines) build query execution plans. The query optimizer builds an execution plan based upon the statistical data available at the time. If you have … Read more

SQL 2014 Cardinality Estimator: Why You Should Care – Part 2

In the previous post I talked about how query optimization works, the role the Cardinality Estimator (CE) plays, and why you should care. Today I am going to break down some of the details about the differences between the old and new CE, as well as show some examples and scenarios. What’s New in the SQL 2014 … Read more

SQL 2014 Cardinality Estimator: Why You Should Care

SQL Server 2014 Cardinality Estimator

This is the first of two posts on the new Cardinality Estimator in SQL Server 2014.  SQL Server 2014 comes with a lot of shiny things. Hekaton (or as Microsoft Marketing likes to call it, In-Memory OLTP), updateable Columnstore indexes, and buffer pool extensions are some of the more common enhancements. All of those new … Read more

Rebuilding Indexes Will Reset Index Usage Statistics in SQL Server 2012

We all know that statistics get updated when you rebuild your indexes, right? OK, for those of you that are not aware of such things here is a blog post from Benjamin Nevarez (blog | @BenjaminNevarez) on the topic. He does a great job of explaining the subtle differences involved with various index and statistics … Read more

HOW TO: Output STATISTICS IO Details Using Powershell

Recently I found myself looking to automate a process that would connect to a database server and run a bunch of queries and return the results of SET STATISTICS IO for each one. I could certainly load my scripts into SSMS and output the results to a text file, but I wanted to leverage Powershell … Read more

Predictive Analysis: I Bet You Didn’t Know I Would Blog This Today

Quick question: Where would you go to find some basil in your local grocery store? Did you say “by the other herbs?” Or did you say “by the tomatoes?” If you are like me, then you would go looking for basil by the other herbs because, well, that is a natural, logical grouping of products. … Read more