Search Results for “scalar functions”

First Responder Kit Release: Now With 100% More Working Code Than The Irish Space Program

Every April I think about this girl I grew up with named April who smelled like Cheez-Wiz. She died tragically in a home for the blind on Taco Tuesday. Special thanks to @jeffrosenberg , @mrthomsmith , @rwhoward for contributing this month. Your complimentary oxygen is now available. The rest of you can go download the First…
Read More

Ten Ways to Set MAXDOP

Configuration Settings
14 Comments
Whenever I work with SQL Server, I’m amazed at how many ways there are to influence its behavior. For example, take the maximum degree of parallelism for a query. Just offhand, I thought of ten different ways you can tweak it: 1. At the server level with SSMS. In SSMS, right-click on the server, click Properties, Advanced,…
Read More

[Video] Office Hours 2016/11/09 (With Transcriptions)

This week, Richie and Erik discuss log backups, migrating from SQL 2008 R2 to 2014, shrinking databases, tuning long-running queries, execution plans, sequencing, encryption, and much more! Here’s the video on YouTube: You can register to attend next week’s Office Hours, or subscribe to our podcast to listen on the go. Enjoy the Podcast? Don’t miss an…
Read More

DBA Days: Money for Nothing, Chips for Free

SQL Server
3 Comments
Throwing hardware at it We gotta move these E5-2670 v3s These were just sitting around Dell. On a table. Not doing anything. They might have been broken; I’m not sure. But that’s not the point. The most meager of server blades hanging out here had 128 GB of RAM in it. One-hundred-and-twenty-eight. Gigabytes. Let that sink…
Read More
Pocket Square

Forced Serialization

Your queries could be going parallel, but because of limitations in SQL Server, they staying serial: single-threaded. A lot of different things can cause this, including running SQL Server Express Edition (which only uses 1 CPU core), but the most common are Scalar UDFs. Paul White’s excellent blog post “Forcing a Parallel Query Execution Plan” has…
Read More

Still Serial After All These Years

SQL Server
30 Comments
With each new version of SQL comes a slew of new stuff While some changes are cosmetic, others bewildering, and the rest falling somewhere between “who cares about JSON?” and “OH MY GOD TAKE MY MONEY!”, but not really my money, because I only buy developer edition. Aaron Bertrand has done a better job finding,…
Read More

Silent CPU Killers

10 Comments
It’s always important to make sure that SQL Server is running at peak efficiency – nobody wants to waste resources. In the past we’ve concentrated on ways to reduce I/O – either network I/O or disk I/O. The increasing number of cores available in modern CPUs meant that CPU tuning wasn’t as much of a…
Read More
Brent Ozar

What’s New in SQL Server 2022 Release Candidate 0: Undocumented Stuff

SQL Server 2022
24 Comments
Microsoft has an official list of what’s new in 2022 overall, but here I’m specifically focusing on system objects that might be interesting to script developers like you and I, dear reader. New stored procedure sp_get_table_card_est_and_avg_col_len – I assume the “card” refers to statistics and cardinality, not Hallmark. SQL Server has historically struggled with memory…
Read More

[Video] Office Hours: Palm Springs, California Edition

Videos
0
On a road trip from San Diego to Vegas, I stopped in Palm Springs and answered your highly-upvoted questions from https://pollgab.com/room/brento. Here’s what we covered: 00:00 Introductions 00:45 i_use_lowercase_for_select: Hi Brent, just wanted to give you my support on your May 24th blog. 01:19 SQL Crooner: Who would win a SQL trivia contest between Brent…
Read More

What It Takes To Write Two Blog Posts

Blogging, Videos
2 Comments
This week, I published two blog posts: How Bad Statistics Cause Bad SQL Server Query Performance How Scalar User-Defined Functions Slow Down Queries Let’s talk about the process of writing ’em. A couple I was putting together this week’s First Responder Kit release, I realized sp_BlitzIndex didn’t have URLs for a couple of common families…
Read More

5 Common T-SQL Anti-Patterns

So far, we’ve covered how to find your server’s most resource-intensive queries, and you’ve opened their execution plans to figure out where the estimates vs actuals go wrong. Now, learn what T-SQL anti-patterns cause the estimates to go wrong. Demo Script Transact-SQL /* Fundamentals of Query Tuning: Common T-SQL Anti-Patterns v1.3 – 2023-11-05 https://www.brentozar.com/go/queryfund This…

To access this incredible, amazing content, you gotta get Fundamentals of Query Tuning or Recorded Class Season Pass, or log in if you already shelled out the cash.
Read More

Fast Food Code

SQL Server
0
Cheap and Easy We’ve all done it. We all know what and where it is, because we’ve probably left a comment for ourselves to go fix it later. It wasn’t me, I swear to myself. Either it was expedient, it seemed to work locally, it was fast on a small amount of data, or we…
Read More

Updated First Responder Kit for November 2018: Get Into Sports Dummy

First Responder Kit Updates
0
COACH! I dunno, I just like this picture. You can download the updated FirstResponderKit.zip here. sp_Blitz Improvements #1786 – @dallyhorton made a good point: if we’re gonna warn you about Change Tracking, we should tell you which database it’s enabled for. #1791 – Who do DMV queries think they are, blocking each other? Get over yourselves. #1793 – CheckIds shouldn’t be…
Read More

08 – Estimates vs Actuals (48m)

Generally, when a query plan operator’s estimated number of rows is vaguely similar to the actual number of rows, SQL Server had a pretty good idea of how much work would be required for that part of the query, and it built an appropriate plan. It may not be a fast plan – for example, maybe…

To access this incredible, amazing content, you gotta get Recorded Class Season Pass, or log in if you already shelled out the cash.
Read More

07 – Execution Plans are Lying Liars (24m)

When you look at the arrows on an actual plan, what do the arrow sizes mean? When you see the list of wait stats, they’re accurate, right? Buckle up and prepare to be disappointed – a lot of what you see in a query plan just flat out isn’t true. Here is the demo script:…

To access this incredible, amazing content, you gotta get Recorded Class Season Pass, or log in if you already shelled out the cash.
Read More

#TSQL2sday: +

SQL Server
5 Comments
For this month’s T-SQL Tuesday, He of Perfect Hair, Bert Wagner asked, “What code have you written that you would hate to live without?” There are a lot of pieces of code I frequently need to reuse when working on the First Responder Kit, like string splitting, XML PATH-ing, and converting milliseconds to some human…
Read More

Microsoft’s Query Tuning Announcements from #PASSsummit

Execution Plans
3 Comments
Microsoft’s Joe Sack & Pedro Lopes held a forward-looking session for performance tuners at the PASS Summit and dropped some awesome bombshells. Pedro’s Big Deal: there’s a new CXPACKET wait in town: CXCONSUMER. In the past, when queries went parallel, we couldn’t differentiate harmless waits incurred by the consumer thread (coordinator, or teacher from my…
Read More