Live classes start in 2d 09h 26m — Save your seat

Index Evaluation and Specialized Indexes

Missing-index advice, filtered indexes, columnstore, and over-indexing.

62 associated posts59 primary posts

Logical Reads Aren’t Repeatable on Columnstore Indexes. (sigh)

Sometimes I really hate my job. Forever now, FOREVER, it's been a standard thing where I can say, "When you're measuring storage performance during index and query tuning, you should always use logical reads, not physical reads, because logical reads are repeatable, and physical reads aren't. Physical reads can change based on what's in cache,…

Read more about Logical Reads Aren’t Repeatable on Columnstore Indexes. (sigh) 12 comments — Join the discussion

How to Query JSON Data Quickly in SQL Server, Part 2: SQL Server 2025

SQL Server 2025 and .NET 10 bring several new improvements to storing JSON natively in the database and querying it quickly. On the SQL Server 2025 side, the two big ones are the new native JSON indexes and the new JSON_CONTAINS function. Let's see their improvements in action. On the .NET 10 side, EF 10…

Read more about How to Query JSON Data Quickly in SQL Server, Part 2: SQL Server 2025 12 comments — Join the discussion
Production DBA

“Oops, I Lost My Indexes in Azure SQL DB.”

I got an interesting request for consulting, and I'm going to paraphrase it: We were using Azure SQL DB with automatic index tuning enabled for months. Things were going great, but... we just deployed a new version of our code. Our deployment tool made the database schema match our source control, which... dropped the indexes…

Read more about “Oops, I Lost My Indexes in Azure SQL DB.” 12 comments — Join the discussion
Performance Tuning

What’s Faster: IN or OR? Columnstore Edition

Pinal Dave recently ignited a storm of controversy when he quizzed readers about which one of these would be faster on AdventureWorks2019:
[crayon-6ae5293320ce1322654218/]
I laughed so hard when I saw the storm of responses on Twitter. People sure do get passionate about this kind of thing. If you ever wanna witness patience and generosity in action, look at Pinal's responses to this tweet.

Read more about What’s Faster: IN or OR? Columnstore Edition 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
Performance Tuning

No, You Can’t Calculate the Tipping Point with Simple Percentages.

This morning, Greg Gonzalez (who I respect) posted about visualizing the tipping point with Plan Explorer (a product I respect), and he wrote: The tipping point is the threshold at which a query plan will "tip" from seeking a non-covering nonclustered index to scanning the clustered index or heap. The basic formula is: A clustered…

Read more about No, You Can’t Calculate the Tipping Point with Simple Percentages. 21 comments — Join the discussion
Production DBA

[Video] How Can I Measure If My Database Does More Reads Than Writes?

When someone asks you, "Is this database read-intensive or write-intensive?" you probably look at sys.dm_io_virtual_file_stats to measure the file activity - but that isn't really correct. After all, your users run a lot of queries all day that are simply satisfied from the buffer pool. SQL Server caches your data so it doesn't have to hit the disks, but ... those are reads, right? (Write? Get it?)

Read more about [Video] How Can I Measure If My Database Does More Reads Than Writes? 17 comments — Join the discussion