Quantcast
Channel: Performance – Kendra Little's Blog
Browsing latest articles
Browse All 121 View Live

Image may be NSFW.
Clik here to view.

Target Recovery Interval and Indirect Checkpoint – New Default of 60 Seconds...

Update, 6/21/2016: Be careful using indirect checkpoint with failover clusters if your SQL Server 2014 instance is not fully patched. See KB 3166902. This bug was fixed in SQL Server 2016 prior to...

View Article


Outside the Big SAN Box: Identifying Storage and SAN Latency in SQL Server...

Note: This is a “listen-able” 36 minute video. You can also listen to this as a podcast – learn how at littlekendra.com/dearsqldba. Here’s today’s question: Dear SQL DBA, What do you say to a SAN...

View Article


Index Usage Stats Insanity – the oddities of sys.dm db index usage stats...

SQL Server’s “index usage stats” dynamic management view is incredibly useful– but does it tell you what you THINK it tells you? Kendra explains the quirks of how sys.dm_db_index_usage_stats works, as...

View Article

Max Degree of Confusion (Dear SQL DBA Episode 8)

Learn how to configure the Max Degree of Parallelism and Cost Threshold for Parallelism settings in SQL Server – and how SQL Server 2014 SP2 and SQL Server 2016 change the way that SQL Server...

View Article

Image may be NSFW.
Clik here to view.

Teach Yourself SQL Server Performance Tuning (Dear SQL DBA Episode 12)

You’d love to have a job tuning SQL Servers, but you don’t have an environment to practice in. Here’s how to teach yourself performance tuning and prepare yourself to land and succeed in job...

View Article


Image may be NSFW.
Clik here to view.

Collect and Baseline Wait Statistics (Dear SQL DBA Episode 14)

What are the best tools to collect and baseline wait statistics? Should you write your own? Watch the 18 minute video or read the episode transcript below. Prefer a podcast?   Dear SQL DBA… I am...

View Article

Image may be NSFW.
Clik here to view.

Estimated vs. Actual Number of Rows in Nested Loop Operators

This is one of those little details that confused me a ton when I was first working with execution plans. One problem with learning to work with plans is that there’s just SO MUCH to look at. And it’s...

View Article

Image may be NSFW.
Clik here to view.

Index Tuning Decision Tree for SQL Server

I recently mapped out my thought process for how I approach a new instance of SQL Server when it comes to index tuning. It now looks like this: Highlight: Can I use Query Store? One of the first...

View Article


Image may be NSFW.
Clik here to view.

Measuring Query Duration: SSMS vs SQL Sentry Plan Explorer

Every query tuner wants to explain exactly how much faster we made a query. But sometimes SQL Server Management Studio adds noticeable overhead to the query duration. For relatively fast queries that...

View Article


Image may be NSFW.
Clik here to view.

Setting up Free Blocking Alerts and Deadlock Monitoring (Dear SQL DBA Episode...

What tools in SQL Server will notify you about blocking and help track the queries behind your toughest blocking and deadlocking problems? Watch the 21 minute video, subscribe to the podcast, or read...

View Article

Can I Use Statistics to Design Indexes? (Dear SQL DBA Episode 18)

Should you look at automatically created statistics on  your tables in SQL Server to help you design better indexes? Learn why in this 20 minute video, or subscribe to the Dear SQL DBA podcast. No...

View Article

Image may be NSFW.
Clik here to view.

What’s Adaptive Query Processing? (Dear SQL DBA Episode 21)

I’m mixing things up a bit in this episode. I want to talk about a question that keynotes and sessions at the SQL PASS Summit got me thinking about last week. Let’s talk about Adaptive Query...

View Article

Image may be NSFW.
Clik here to view.

Filtered Indexes: Rowstore vs Nonclustered Columnstore

SQL Server has two types of filtered indexes: The “classic” filtered nonclustered rowstore index, introduced in SQL Server 2008, available in all editions The newfangled filtered nonclustered...

View Article


Image may be NSFW.
Clik here to view.

Should I change the ‘locks’ configuration in SQL Server?

I recently got a fantastic question from a reader regarding lock usage in SQL Server. Here’s the question: One of my production databases has a total lock count around 25,000 (select count(*) from...

View Article

Image may be NSFW.
Clik here to view.

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. Watch the 26 minute video or scroll on down and read the written version of the episode instead. If...

View Article


Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

When Did SQL Server Last Update That Statistic? How Much Has Been Modified...

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...

View Article


Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

Actual Time Statistics in Execution Plans: Elapsed CPU Time and more

One of the coolest things to come to SQL Server Management Studio in a long time might be hard to see at first: it’s tucked away in the Properties Window. But once you see it, it might just be...

View Article

Image may be NSFW.
Clik here to view.

Collecting the Blocked Process Report (XEvents and Server Side Trace)

I’m a big fan of the built-in Blocked Process Report in SQL Server. It’s come in handy for troubleshooting blocking situations for me many times. I wanted a friendly way to share code to configure and...

View Article

Image may be NSFW.
Clik here to view.

Columnstore Indexes and Computed Columns in SQL Server 2016

You can’t do everything with a columnstore index — but SQL Server’s optimizer can get pretty creative so it can use a columnstore index in ways you might not expect. You can’t put a computed column in...

View Article


Image may be NSFW.
Clik here to view.

Parallelism and tempdb data file usage in SQL Server

I’m sometimes asked if the number of CPU cores used by a query determines the number of tempdb files that the query can use. Good news: even a single threaded query can use multiple tempdb data files....

View Article


Image may be NSFW.
Clik here to view.

Administering COTS databases (ISVs / Third Party Vendors)

I recently received this question from a reader… I just moved from an in-house software development company to a new environment that most of the software used here are COTS (Commercial off-the-shelf)...

View Article

Image may be NSFW.
Clik here to view.

How to Find Queries Using an Index (and Queries Using Index Hints)

Sometimes you know a query is out there, but it’s hard to find the exact query. SQL Server stores query execution plans in cache, but it can be difficult to query the XML it stores. And there’s always...

View Article

Image may be NSFW.
Clik here to view.

What’s that Garbage in my Execution Plan? (Dear SQL DBA Episode 27)

Today I was working on some code samples for a user question, and I hit a weird roadblock. There was a bunch of garbage in my execution plan that I couldn’t explain. And by ‘garbage’, I mean a nested...

View Article


Image may be NSFW.
Clik here to view.

Should I Learn Fulltext Indexing? (Dear SQL DBA Episode 29)

This week’s question is about a longstanding feature in SQL Server that sounds really cool: full-text search. If you’re learning performance tuning, how much time should you invest in researching and...

View Article

Image may be NSFW.
Clik here to view.

Confused by sp_who2 (Dear SQL DBA Episode 30)

This week’s ‘Dear SQL DBA’ question gets us down to the essentials Recently, when I was checking if there are any hanging transactions in my database via “sp_who2 ” procedure… A transaction is...

View Article

Index Maintenance and Performance (Dear SQL DBA Episode 38)

They made their index maintenance job smarter, and their queries got slower in production afterward. Could the index maintenance have harmed performance? In this 29 minute episode… 00:50 Thinking...

View Article

Are Bad Statistics Making My Query Slow? (Dear SQL DBA Episode 39)

An important query is suddenly slow. Is it because statistics are out of date? This is tricky to figure out, and updating statistics right away can make troubleshooting even harder. Learn how to use...

View Article



Image may be NSFW.
Clik here to view.

Read from the Right End of the Index: BACKWARD Scans

Optimizing queries is the most fun when you don’t need to add indexes. There’s nothing quite so nice as finding a way to make reading data faster, without slowing down writes or creating new data...

View Article

Image may be NSFW.
Clik here to view.

Dirty Pages and Statistics IO

Warning: The DROPCLEANBUFFERS command referenced in this post is appropriate for test systems only and impacts the entire SQL Instance. If you are new to SQL Server, please use this commands with...

View Article

Image may be NSFW.
Clik here to view.

The Magic of the Self-Assigned Lab (SQLSkills Immersion Training Days 2 and 3)

The duck has obtained scuba gear-- it can go to new depths on its own. Today, more blog from SQLSkills Immersion Training on Internals and Performance in Dallas, TX. For more about the training, see...

View Article

Image may be NSFW.
Clik here to view.

How To: Automate Continuous SQLServer Activity with Stored Procedures and...

The Goal It’s often useful to be able to run a bunch of stored procedures in the background over a period of time against a test instance. This can be nice for: Demos and presentations. Populating...

View Article


Image may be NSFW.
Clik here to view.

There’s more than one way to skin an eggplant: Using APPLY for calculations

Choices, choices Here’s a little TSQL snack. I picked this up in a presentation by Itzik Ben-Gan at the PNWSQL user group recently, and it’s become a fast favorite. CROSS APPLY and OUTER APPLY-...

View Article

Image may be NSFW.
Clik here to view.

DBCC USEROPTIONS: See Your Session Settings in SQL Server

This is a super old command, but it still comes in handy when working with SQL Server. Want to know your default isolation level in the current database? Run this. (If optimistic locking is turned on...

View Article

Image may be NSFW.
Clik here to view.

Did My Query Eliminate Table Partitions in SQL Server?

Working with table partitioning can be puzzling. Table partitioning isn’t always a slam dunk for performance: heavy testing is needed. But even getting started with the testing can be a bit tricky!...

View Article


Image may be NSFW.
Clik here to view.

Does OPTION (RECOMPILE) Prevent Query Store from Saving an Execution Plan?

Recompile hints have been tough to love in SQL Server for a long time. Sometimes it’s very tempting to use these hints to tell the optimizer to generate a fresh execution plan for a query, but there...

View Article


Image may be NSFW.
Clik here to view.

Joins, Predicates, and Statistics in SQL Server

Joins can be tricky. And where you put your ‘where’ clause may mean more than you think! Take these two queries from the AdventureWorksDW sample database. The queries are both looking for data where...

View Article

Image may be NSFW.
Clik here to view.

3 Things I Wish I’d Learned Earlier as a SQL Server DBA

Back in my day, we used a courier for log shipping. Hindsight is everything. I was lucky to be trained by a great team of DBAs back when I first started with SQL Server. But it’s hard to know exactly...

View Article

Image may be NSFW.
Clik here to view.

How to Find Missing Index Requests in Query Store

SQL Server 2016’s new Query Store feature makes it easier than ever for DBAs and developers to identify the most important queries to tune– and perhaps apply a quick fix by pinning an execution plan....

View Article

Image may be NSFW.
Clik here to view.

Does Query Store’s “Regression” Always Catch Nasty Parameter Sniffing?

SQL Server 2016’s new Query Store feature has an option that looks for “regressed” query plans. Plan choice regression is explained in Books Online this way: During the regular query execution Query...

View Article


Image may be NSFW.
Clik here to view.

SQL Server’s YEAR() Function and Index Performance

SQL Server’s really clever about a lot of things. It’s not super clever about YEAR() when it comes to indexes, even using SQL Server 2016 — but you can either make your TSQL more clever, or work...

View Article

Image may be NSFW.
Clik here to view.

Live Query Statistics Don’t Replace Actual Execution Plans

I like SQL Server’s new Live Query Statistics feature a lot for testing and tuning large queries. One of my first questions was whether this could replace using actual execution plans, or if it’s...

View Article


Image may be NSFW.
Clik here to view.

3 Tricks with STATISTICS IO and STATISTICS TIME in SQL Server

When  you need to measure how long a query takes and how many resources it uses, STATISTICS TIME and STATISTICS IO are great tools for interactive testing in SQL Server. I use these settings...

View Article

Image may be NSFW.
Clik here to view.

Updating Statistics in SQL Server: Maintenance Questions & Answers

I’ve been asked a lot of questions about updating statistics in SQL Server over the years. And I’ve asked a lot of questions myself! Here’s a rundown of all the practical questions that I tend to get...

View Article


Managing Statistics in SQL Server for DBAs (videos)

Want to learn more about managing statistics updates in SQL Server? Watch my free 27 minute presentation on managing statistics: You can also watch 12 minutes of audience Q&A on statistics from...

View Article

Image may be NSFW.
Clik here to view.

Why Table Partitioning Doesn’t Speed Up Query Performance (video)

Learn why SQL Server’s table partitioning feature doesn’t make your queries faster– and may even make them slower. In this 20 minute video, I’ll show you my favorite articles, bugs, and whitepapers...

View Article

Image may be NSFW.
Clik here to view.

The Case of the Blocking Merge Statement (LCK_M_RS_U locks)

Recently I got a fun question about an “upsert” pattern as a “Dear SQL DBA” question. The question is about TSQL, so it lent itself to being answered in a blog post where I can show repro code and...

View Article

SQLServer:Databases(_Total)\Transactions/sec vs SQL Statistics\Batch...

Perfmon counters are great for measuring workload, but choosing which counter to baseline can be confusing. The Transactions/sec counter has big blind spots Watch a quick 5 minute demo showing that...

View Article


How Do I Analyze a SQL Server Execution Plan?

A query is slow, and you figure out how to collect the query execution plan. Now what? In this video, I talk “big picture” about what execution plans are, what “cost” is, why to collect “compiled for”...

View Article

Browsing latest articles
Browse All 121 View Live