Indexing and Statistics

Designing, evaluating, maintaining, and troubleshooting indexes and statistics.

568 associated posts270 primary posts

Office Hours: Read This, Watch This Edition

This week, a lot of the questions you posted at https://pollgab.com/room/brento just need pointers to resources at other places. Welcome to the Read This, Watch This series of answers.

Don't Blame Anthony: Our developers prefer writing TSQL queries directly in their .NET code rather than writing sprocs and calling them. What are the pros / cons to this approach?

Read more about Office Hours: Read This, Watch This Edition 1 comment — Join the discussion
Production DBA

Office Hours: One-Word Answers Edition

Some of the questions y'all post at https://pollgab.com/room/brento are pretty straightforward. Let's get 'er done. LetTheDbaHandleIt: My friend needs to track who has accessed what data. This is easy at OS and app level, but how can my friend verify that those who have direct DB access are not snooping on data inappropriately? e.g. payroll or…

Read more about Office Hours: One-Word Answers Edition 5 comments — Join the discussion
Production DBA

Office Hours Speed Round, Text Edition

Got questions for me? Post 'em at https://pollgab.com/room/brento and upvote the ones you'd like to see me cover. I filter out the ones that are too short for video answers, and here's the latest batch:

Corrupted: Should DBCC CheckDB be run on secondary replicas in AG as well ? Is it recommended to attach corrupted database to Prod server, to check how your integrity check job will react ?

Read more about Office Hours Speed Round, Text Edition 20 comments — Join the discussion
Performance Tuning

Why Adding Some Memory Doesn’t Fix All Caching Problems

It seems obvious: add some memory, and SQL Server should be able to cache data, thereby making queries run faster ... right?

Well, if you can't cache everything you need for a query, you might be surprised to find that SQL Server may still read the entire table up from disk, regardless of what parts of the table are currently cached in memory.

Read more about Why Adding Some Memory Doesn’t Fix All Caching Problems 19 comments — Join the discussion

Columnstore Indexes are Finally Sorted in SQL Server 2022.

There's a widespread misconception that SQL Server's columnstore indexes are like an index on every column.

I debunk that myth in the first 30 minutes of my Fundamentals of Columnstore class, where I explain that a better way to think of them is that your table is broken up into groups of rows (1M rows or less per group), and in each group, there's an index on every column.

Read more about Columnstore Indexes are Finally Sorted in SQL Server 2022. 23 comments — Join the discussion