Blogs

Which Filegroup is that Partition Using? How Many Rows Does It Have?

Which Filegroup is that Partition Using? How Many Rows Does It Have?

Table Partitioning in SQL Server has a bit of a learning curve. It’s tricky to just figure out how much data you have and where the data is stored.

Continue reading

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

What is 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 loop to a whole branch of code that I hadn’t asked SQL Server to run – and a warning about an implicit conversion possibly causing problems with the quality of my execution plan.

Continue reading

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

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

on January 24, 2017 • 5 min read

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 a chance that the query plan won’t be there, due to memory pressure, recompile hints, or the plan cache being cleared by setting changes or other administrative actions.

Continue reading

Why You Should Switch in Staging Tables Instead of Renaming Them (Dear SQL DBA Episode 26)

Why You Should Switch in Staging Tables Instead of Renaming Them (Dear SQL DBA Episode 26)

Over the years, I’ve come across a pattern fairly frequently: an application in an OLTP database periodically creates new tables, loads some data into them and fixes it up, then does a switcheroo and replaces old tables with the new tables.

This can cause major problems with blocking if anyone else is querying the table.

Continue reading

Bug: Incorrect modification_counter for Column Stats on Tables with a Clustered Columnstore Index

Bug: Incorrect modification_counter for Column Stats on Tables with a Clustered Columnstore Index

By Kendra Little on January 17, 2017 • 2 min read

I don’t find bugs in SQL Server all that often. I find bugs in my own code all the time.

In this case I double checked, and I think it’s a real SQL Server bug.

Continue reading

How to Query Histogram Target XML in Extended Events

How to Query Histogram Target XML in Extended Events

on January 12, 2017 • 3 min read

When I was recently testing tempdb file usage, I used an Extended Events session that used SQL Server’s histogram target to track sqlserver.file_read events in the tempdb database for a specific session.

Continue reading

Administering COTS databases (ISVs / Third Party Vendors)

Administering COTS databases (ISVs / Third Party Vendors)

By Kendra Little on January 10, 2017 • 4 min read

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

Continue reading