Search Results for “execution plan”

Pocket Square

High Compilations per Second

sp_BlitzFirst® Result: High Compilations per Second According to sp_BlitzFirst®‘s diagnostics, your SQL Server is having to compile more than 10% of the incoming T-SQL requests. When SQL Server sees a query for the first time, it has to build a new execution plan for it. This can cause high CPU use for building that plan –…
Read More

Get a Report of Your Server’s Top 10 Worst Queries

SQL Server
5 Comments
Problem: your database server’s performance stinks like Limburger cheese. Photo courtesy of http://en.wikipedia.org/wiki/File:Wisconsin_Limburger_Cheese.JPG Solution: find the queries that are making that smell. Hiding in Plain Sight Your database server knows exactly which queries are performing the worst. When queries are executed, the execution plans – and associated execution statistics – are stored in memory (with…
Read More

Performance Tuning kCura Relativity

kCura Relativity, SQL Server
5 Comments
In the e-discovery business, kCura Relativity is the big gorilla, and I’ve been working with kCura and their clients since 2011. I think it’s one of the most interesting businesses I’ve ever worked with – up there with StackOverflow – and like Stack, they’re really open with their customers. George Nedwick and I staffing the…
Read More

My Five Favorite That Conference Memories

SQL Server
3 Comments
Last week, I went to summer camp for geeks, and I had a great time! That Conference is a three-day, developer-focused, family-friendly technology conference. Camp was held for the first time in 2012. I heard such great things about it from last year’s campers that I decided to go this year! The sessions focused on…
Read More
Pocket Square

Memory Pressure Affecting Queries

When your query starts, it asks – begs, really – for a certain amount of memory to store its results, do sorts, join things together, and contemplate life. The amount of memory is determined by how much data will be pulled back from each table, how big the rows are, and so forth. SQL Server…
Read More

New DMVs in SQL Server 2014 CTP1

SQL Server
27 Comments
When you download and start playing with SQL Server 2014 CTP1, here’s a few of the new instrumentation tables and views: New Internal Tables plan_persist_context_settings plan_persist_plan – Hey, lookie there! Implies that we can persist execution plans beyond a SQL Server service restart. plan_persist_query plan_persist_query_text plan_persist_runtime_stats plan_persist_runtime_stats_interval New Views column_store_row_groups dm_db_merge_requests dm_db_xtp_checkpoint – Note that both…
Read More

Optimize for… Mediocre?

Some query hints sound too good to be true. And, unfortunately, usually they aren’t quite as magical as they might seem. Frustration with unpredictable execution times People often learn about parameter sniffing when query execution times stop being predictable. Occasionally you’ll hear about a stored procedure taking much longer than normal, but the next time…
Read More
Pocket Square

Get Top Resource-Consuming Queries

1 Comment
sp_BlitzCache™ will get the top resource-intensive queries in the plan cache. It’s safe to run on heavily loaded servers – it’s going to take a few seconds to run, but it won’t block execution of other queries. This will not work on SQL Server 2005. You can download a legacy version of this script for your…
Read More

How Does SQL Server Store Data?

SQL Server
60 Comments
Let’s step back and take a look at the big picture.  (Today, I’m writing for beginners, so you advanced gurus can go ahead and close the browser now.  I’m going to simplify things and leave a lot out in order to get some main points across.  Don’t well-actually me.) Microsoft SQL Server databases are stored…
Read More
Pocket Square

Stored Procedure Created WITH RECOMPILE Option

sp_Blitz Result: Stored Procedure WITH RECOMPILE Option When you create a stored procedure using the WITH RECOMPILE option, it gets a brand new execution plan every time it runs.  This can be good for high performance queries because they get a plan perfect for the variables that are passed in.  However, this causes increased CPU…
Read More
Pocket Square

User-Defined Functions Slowing Down SQL Server

Blitz Result: User-Defined Functions Good development practices dictate building reusable code, and user-defined functions seem like a good way to promote code reuse.  Unfortunately, it turns out that SQL Server doesn’t perform well with most scalar user-defined functions. This part of our SQL Server sp_Blitz script checks the plan cache looking for resource-intensive queries that…
Read More
Pocket Square

Missing Index

Blitz Result: Missing Index Found in the Plan Cache SQL Server can use indexes to make queries run much faster, and while it’s executing queries, it tracks which indexes it wishes would have been around.  We can query the DMVs to discover what indexes SQL Server recommends, and we can also check the plan cache…
Read More
Pocket Square

Implicit Conversion

This is when you mismatch data types in a WHERE clause or JOIN condition, and SQL Server needs to convert one on the fly. The penalty you pay here is that indexes won’t be used efficiently, you’ll burn CPU in the conversion process, and in the case of inadequate indexing, no missing index request will…
Read More
Pocket Square

SQL Server Training Classes by Brent Ozar

One-Day Fundamentals You need to make SQL Server fast and reliable. I do this stuff in real life every week, and I can teach you how to make it happen. Start with the top left box (How I Use the First Responder Kit) and then only take classes that border classes you’ve already taken. For…
Read More

The Use and Abuse of RECOMPILE in SQL Server (Video)

7 Comments
What are the costs when you ask SQL Server to recompile a statement or a stored procedure each time it runs? In this 30 minute talk Kendra Little explains the impact on query execution– and on your SQL Server instance– of forcing recompilation. This talk is appropriate for DBAs and Developers who have a working…
Read More