Live classes start in 31d 04h 42m — Save your seat

Category: Index Maintenance

Database Animations: You’ve Heard of Page Splits. Here’s What They Really Mean.

You've heard that page splits are bad, and they're an indication that your table design is making your storage work too hard. You've heard that the right answer to fix it is adjusting fill factor lower, or doing regular index maintenance.

Before you watch the below animation, you'll wanna get up to speed with how index seeks work. Then, let's explain page splits with an animation:

Read more about Database Animations: You’ve Heard of Page Splits. Here’s What They Really Mean. 15 comments — Join the discussion

Index Rebuilds Make Even Less Sense with ADR & RCSI.

Accelerated Database Recovery (ADR) is a database-level feature that makes transaction rollbacks nearly instantaneous. Here's how it works.

Without ADR, when you update a row, SQL Server copies the old values into the transaction log and updates the row in-place. If you roll that transaction back, SQL Server has to fetch the old values from the transaction log, then apply them to the row in-place. The more rows you've affected, the longer your transaction will take.

Read more about Index Rebuilds Make Even Less Sense with ADR & RCSI. 6 comments — Join the discussion

[Video] What Percent Complete Is That Index Build?

SQL Server 2017 & newer have a new DMV, sys.index_resumable_operations, that show you the percent_completion for index creations and rebuilds. It works, but...only if the data isn't changing. But of course your data is changing - that's the whole point of doing these operations as resumable. If they weren't changing, we could just let the operations finish.

Read more about [Video] What Percent Complete Is That Index Build? 6 comments — Join the discussion

Does the Rowmodctr Update for Non-Updating Updates?

Update May 20 - make sure to read to the end for an update.

Okay, look, it's a mouthful of a blog post title, and there are only gonna be maybe six of us in the world who get excited enough to check this kind of thing, but if you're in that intimate group, then the title's already got you interested in the demo. (Shout out to Riddhi P. for asking this cool question in class.)

Read more about Does the Rowmodctr Update for Non-Updating Updates? 11 comments — Join the discussion

Stats Week: Only Updating Statistics With Ola Hallengren’s Scripts

I hate rebuilding indexes
There. I said it. It's not fun. I don't care all that much for reorgs, either. They're less intrusive, but man, that LOB compaction stuff can really be time consuming. What I do like is updating statistics. Doing that can be the kick in the bad plan pants that you need to get things running smoothly again.

Read more about Stats Week: Only Updating Statistics With Ola Hallengren’s Scripts 46 comments — Join the discussion

Why most of you should leave Auto-Update Statistics on

Oh God, he's talking about statistics again Yeah, but this should be less annoying than the other times. And much shorter. You see, I hear grousing. Updating statistics was bringin' us down, man. Harshing our mellow. The statistics would just update, man, and it would take like... Forever, man. Man. But no one would actually…

Read more about Why most of you should leave Auto-Update Statistics on 16 comments — Join the discussion
Performance Tuning

Testing ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY in SQL Server 2014

One of the blocking scenarios I find most interesting is related to online index rebuilds. Index rebuilds are only mostly online. In order to complete they need a very high level of lock: a schema modification lock (SCH-M).

Here's one way this can become a big problem:

Read more about Testing ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY in SQL Server 2014 14 comments — Join the discussion

How to Configure Ola Hallengren’s IndexOptimize Maintenance Script

If you're a production database administrator responsible for backups, corruption checking, and index maintenance on SQL Server, try Ola Hallengren's free database maintenance scripts. They're better than yours (trust me), and they give you more flexibility than built-in maintenance plans.

However, the index maintenance defaults aren't good for everyone. Here's how they ship:
[crayon-6abf306f7058e440339162/]
The defaults on some of these parameters are a little tricky:

Read more about How to Configure Ola Hallengren’s IndexOptimize Maintenance Script 138 comments — Join the discussion

Why Index Fragmentation and Bad Statistics Aren’t Always the Problem (Video)

Do you rely on index rebuilds to make queries run faster? Or do you always feel like statistics are "bad" and are the cause of your query problems? You're not alone-- it's easy to fall into the trap of always blaming fragmentation or statistics. Learn why these two tools aren't the answer to every problem…

Read more about Why Index Fragmentation and Bad Statistics Aren’t Always the Problem (Video) 1 comment — Join the discussion