Performance-Tuning

Tag: performance-tuning

Trace Flag 4199: No Per-Session Override if You Enable it Globally

Trace Flag 4199: No Per-Session Override if You Enable it Globally

You can enable and disable trace flags either globally or per-session in SQL Server.

This makes it seem like perhaps if you enable optimization trace flag 4199 globally for all sessions, you might be able to disable it per-session.

But that’s NOT how it works.

Continue reading

Administering COTS databases (ISVs / Third Party Vendors)

Administering COTS databases (ISVs / Third Party Vendors)

I recently received a question from a vendor about databases created by software vendors.

Continue reading

How to Tune Indexes for a Stored Procedure

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)

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?

Should I change the locks configuration in SQL Server?

on November 22, 2016

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

Which is Worse: an Unused Index, or an Un-Indexed Foreign Key? (Dear SQL DBA Episode 16)

Which is Worse: an Unused Index, or an Un-Indexed Foreign Key? (Dear SQL DBA Episode 16)

Should you always index your foreign keys? What if you index them, and then the index never gets used?

Continue reading

Index Tuning Decision Tree for SQL Server

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.

Continue reading