Blogs

Index Create and Last Modified Dates in SQL Server

In many environments, it’s useful to know exactly when an index was created or modified.

Did that last code release help performance, or hurt it? It’s really helpful to know exactly when the code was deployed to prove that your change made something better. Or that you might need to roll it back.

It takes a little preparation to track changes to your indexes, but it’s easy to implement.

Continue reading

Does Truncate Table Reset Statistics?

Short answer: the SQL Server optimizer will know that the table was truncated, but statistics might not update when you expect.

For the long answer, let’s walk through an example using the WideWorldImporters sample database.

Continue reading

When Did SQL Server Last Update That Statistic? How Much Has Been Modified Since? And What Columns are in the Stat?

Whether I’m working as a DBA, a consultant, a teacher, or just answering questions in my inbox, I always end up needing a script to inspect statistics one way or another.

Here are some freshly written scripts for a classic DBA question: what’s going on in my stats?

Continue reading

Signs Your SQL Server is Running with Scissors (Dear SQL DBA Episode 24)

Does your team know what it’s doing with SQL Server?

Learn what a consultant looks for when assessing a team, and signs that SQL Server may be badly configured.

Continue reading

Learn to Tune Indexes in Lisbon on March 9, 2017

Want to learn to tune indexes in SQL Server? I’ll be teaching a day-long pre-conference session in Portugal in March. Hope to see you there, or at SQL Saturday Lisbon (free!) the following weekend.

Continue reading

How to Tune Indexes for a Stored Procedure

You’ve got an important stored procedure that you think needs index help– but it runs in environment with lots of other queries. How do you focus in and discover exactly what indexes need tuning for that procedure?

Continue reading

Why is My Query Faster the Second Time it Runs? (Dear SQL DBA Episode 23)

Today’s question is about why a query might be slow at first, then fast the next time you run it.

Continue reading

Should I change the locks configuration in SQL Server?

I recently got a fantastic question from a reader regarding lock usage in SQL Server:

One of my production databases has a total lock count around 25,000 (select count(*) from sys.dm_tran_locks). The configuration setting for locks is set to the default of zero. This lock count is due to multiple procedures which frequently run and use the same 2-3 tables, repeatedly taking out and releasing locks. Do I need to change the configuration for locks or look into the SP’s so they can finish more quickly, rather than creating locks?

Continue reading

Should I Upgrade to SQL Server 2016? (Dear SQL DBA Episode 22)

It’s a big week for SQL Server! And it’s the perfect week to talk about this week’s question, which is about explaining to your management why it’s worth it to upgrade to SQL Server 2016, and which features you can use right away.

Continue reading

SQL Server 2016 SP1: Features Added to Standard, Web, Express, Local DB Editions

Wouldn’t it be awesome if you could develop your application for a small SQL Server using the same features that you intend to use for scale?

And wouldn’t it be more awesome if you could start using bleeding edge features like In-Memory OLTP on some of your less-risky, smaller databases first?

Continue reading