Development

What’s the Difference Between Estimated and Actual Execution Plans?

I’m going to use the dbo.Users table in the StackOverflow demo database and run a pretty simple query: Transact-SQL SELECT * FROM dbo.Users WHERE DisplayName LIKE 'Brent%'; 123 SELECT *FROM dbo.UsersWHERE DisplayName LIKE 'Brent%'; First, hit Control-L in SSMS and get the estimated execution plan. Here it is: Estimated execution plan: https://www.brentozar.com/pastetheplan/?id=H1TeRlZke Click on the…
Read More

A Little Fun With Math

SQL Server, T-SQL
5 Comments
I’ve never been much at math But I’ve always liked reading about it. It’s super interesting, and it always blows my mind. Like, guaranteed. Once in a while I’ll even try my hand at solving problems I read about in SQL. Not because SQL is a particularly good language for it; but just because sometimes…
Read More

SQL Server 2016 Standard Edition Now Has Many Enterprise Edition Features.

Starting with today’s release of SQL Server 2016 Service Pack 1, Standard Edition now has a lot more of the features of Enterprise Edition. Here’s the list from Microsoft’s announcement post: Performance features – in-memory OLTP (Hekaton), in-memory columnstore, operational analytics Data warehousing features – partitioning, compression, CDC, database snapshots Some security features – Always Encrypted,…
Read More

Set Statistics… Profile?

Development
4 Comments
Forgotten, But Not Gone Two of the best built-in tools to figure out if your query tuning efforts are headed in the right direction are SET STATISTICS TIME ON and SET STATISTICS IO ON. If you’re really fancy, you can use SET STATISTICS TIME, IO ON. By fancy I mean lazy. By lazy I mean…
Read More

Query Tuning Week: How to Run sp_BlitzCache on a Single Query

The most popular way of using sp_BlitzCache® is to just run it – by default, it shows you the top 10 most CPU-intensive queries that have run on your server recently. Plus, it shows you warnings about each of the queries – if they’re missing indexes, experiencing parameter sniffing issues, running long, running frequently, doing…
Read More