Skewing Parallelism For Fun And Profit
What Is Skewed Parallelism? When queries go parallel, some assumptions get made: There’s enough work to keep multiple threads busy Each thread will get an equal amount of work to do The ‘equal amount...
View ArticleBatch Mode For Row Store: What Does It Help With?
SQL Server 2019 Introduces something pretty cool: the ability for row store indexes to be processed in batch mode. Batch mode is, of course, the preferred processing realm of column store indexes. If...
View ArticleBatch Mode For Row Store: Does It Fix Parameter Sniffing?
Snorting The Future SQL Server 2019 introduced batch mode over row store, which allows for batch mode processing to kick in on queries when the optimizer deems it cost effective to do so, and also to...
View ArticleFiltered Indexes vs Parameterization (Again)
At First I Was Like… This won’t work at all, because parameters are a known enemy of filtered indexes. But it turns out that some filtered indexes can be used for parameterized queries, whether they’re...
View ArticleSUM, AVG, and arithmetic overflow
You Shoulda Brought A Bigger Int Sometimes you run a query, and everything goes fine. For a while. For example, if I run this query in the 2010 copy of Stack Overflow, it finishes pretty quickly, and...
View ArticleThe Curse of Cursor Options
Red Skies At Night I know it’s hard to believe, but I still see a lot of people using cursors when they shouldn’t. Other times, there’s some scary dungeon part of the code that someone wrote eons ago...
View ArticleAdventures In Foreign Keys 1: Eligibility Is Everything
In A Foreign Key, In A Foreign Table Much of what people want from foreign keys, like referential integrity and join elimination, are only as guaranteed as much as SQL Server can trust your constraints...
View ArticleAdventures In Foreign Keys 2: Difficulties, Difficulties, Difficulties
This week, we’re all about foreign keys. Yesterday’s post covered scripts to set up the Stack Overflow database to get ready, eliminating data that would violate FK relationships. You Had Two Jobs!...
View ArticleAdventures In Foreign Keys 3: A Cascade Of Badness
Legendreary In the last post, I looked at some issues with implementing foreign keys with cascading actions. Namely that, well, it fell apart pretty quickly just trying to set up. I didn’t even get to...
View ArticleAdventures In Foreign Keys 4: How Should I Index These Things?
This week, we’re all about foreign keys. So far, we set up the Stack Overflow database to get ready, then tried to set up relationships, and encountered cascading locking issues. Dawn Of The Data I...
View ArticleAdventures In Foreign Keys 5: The Limits Of Elimination
FINALLY… This is the last post I’ll write about foreign keys for a while. Maybe ever. Let’s face it, most developers probably find them more annoying than useful, and if you didn’t implement them when...
View ArticleGoing to SQLBits in 2019? Come to my pre-con!
My Favorite Conference I love SQLBits, and not just because it gets me out of the country for a week. It’s about the best conference a training buck can buy. There’s tons of great technical material...
View ArticleNot So Forced Parameterization
Asking The Wrong Question Sometimes, when you wanna turn on a feature, you spend so much time wondering if you should, you don’t bother asking if it’ll even work when you do. There are a long list of...
View ArticleGetting Sneaky With Forced Parameterization
Silly Rules I’ve blogged about some of the silly rules about where Forced Parameterization doesn’t work. One rule that really irked me is this one: The TOP, TABLESAMPLE, HAVING, GROUP BY, ORDER BY,...
View ArticleTales From Overindexing: Too Many One Column Indexes
Master Plan Sometimes you see a query, and it’s hitting one table, and then the query plan looks like a vase full of spaghetti. Usually, there’s a view involved. Usually. Sometimes, there’s just really...
View ArticleUpdated First Responder Kit for November 2018: Get Into Sports Dummy
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...
View ArticleIndexed View Creation And Underlying Indexes
Accidental Haha While working on some demos, I came across sort of funny behavior during indexed view creation and how the indexes you have on the base tables can impact how long it takes to create the...
View ArticleIndexed View Matching With GROUP BY And DISTINCT
Bit Of A Kick I’ve been playing with indexed views a little bit lately for some demos in my Bits Precon. There are a whole bunch of limitations in creating indexed views. One of them is that you can’t...
View ArticleHave Availability Groups Gotten Easier Lately?
Easy Lover I don’t blog a lot about AGs. If we’re being honest (and I do try to be honest with you, dear reader), I just like performance tuning topics way more. When new features get announced for...
View ArticleNever Judge A Query By Its Cost
Signs and Numbers When tuning queries, or even finding queries to tune, there’s a rather misguided desire to look for queries with a high cost, or judge improvement by lowering query cost. The problem...
View Article