Storage structures 3 – Memory-optimized

No Comments
Update February 26: The maximum of 8 memory-optimized indexes per table was dropped in SQL Server 2017. After discussing traditional on-disk rowstore storage in part 1 and columnstores in part 2, it is now time to turn our eye towards memory-optimized storage structures in SQL Server. Memory-optimized storage was introduced in SQL Server 2014, as part of a project that was codenamed “Hekaton” and later renamed to in-memory OLTP. Whereas columnstore indexes were specifically targeted towards large scale analytical work, Hekaton and memory-optimized tables are specifically geared towards high volume OLTP workloads. By fully eliminating locks and latches, and using…
Read More

Optimized Locking part 1: Transaction ID Locking

No Comments
SQL Server 2025 introduced Optimized Locking. Not one, but two features, sharing a single marketing name. Transaction ID (TID) Locking One of these two features is Transaction ID (TID) Locking. Slated to end the memory waste of thousands of individual row locks, and the concurrency killer of lock escalation. What it is, how does it work, what are the limitations, and do we really get a free lunch? More of me? Was this useful to you? Do you want to learn more from me? You can click here to see an overview of my scheduled conference talks. If you attend…
Read More

T-SQL Tuesday 195 – Code that aged well

No Comments
It’s the second Tuesday of the month again. Time for T-SQL Tuesday, edition 195. This edition is hosted by Pat Wright, who wants to know whether our code aged well. The timing of that question could not have been any better for me, because I am right now working on an assignment related to a database system that I first worked for over 10 years ago! The database system I started working for the company in summer 2013. This was on employment, with a one-year contract. They used a SQL Server database to support their subscription administration and invoicing process.…
Read More

Rowgoals, part 3: When rowgoals backfire

No Comments
In part 1 of this mini-series, I explained what a rowgoal is and how it works to optimize a query with a TOP or FETCH expression. Part 2 then showed a few less obvious other cases where the optimizer might introduce rowgoals. In all cases so far, those rowgoals were beneficial. They helped the optimizer come up with the best execution plan for the number of rows requested. Things can go wrong! Unfortunately, there are cases where a plan that is optimized with a rowgoal turns out to be slower than without the rowgoal. The feature that is intended to…
Read More

Storage structures 2 – Columnstore

No Comments
Update February 4, 2026: I have updated this post with new information, about deleted bitmaps, and about the delete buffer for nonclustered columnstore indexes. Update February 5, 2025: Another update, fairly small in this case. Ordered columnstore indexes were introduced in SQL Server 2022. In the first part of this series, I described the storage structure and access patterns for SQL Server’s traditional storage structure: on-disk rowstore indexes (heaps and B-trees). Columnstore indexes were introduced in SQL Server 2012. In that version only nonclustered columnstore indexes were supported (so they stored a copy of the data in the included columns,…
Read More

Rowgoals, part 2: Rowgoals in unexpected places

No Comments
In my previous vlog, I showed how and why the optimizer uses a rowgoal in the execution plan when your query uses a TOP or FETCH expression. Those are the keywords where this rowgoal is very obvious. Unexpected rowgoals But it’s not always that obvious. There are several other situations where rowgoals can be used, and some of them can be very unexpected! https://youtu.be/QwgiPTDMGQM More of me? Was this useful to you? Do you want to learn more from me? You can click here to see an overview of my scheduled conference visits. If you attend one of those, you…
Read More
A picture that shows several soccer goals, aligned in rows.

Rowgoals, part 1: How do rowgoals work?

No Comments
For my second vlog, I decided to talk about rowgoals. First an explanation of what they are, then an overview of some obvious and some not so obvious cases where the optimizer will use a rowgoal, and finally a warning about cases where this normally beneficial feature might hurt instead of help. And then, after recording and editing, I had a video of over 35 minutes. I felt that this might be too long for the format of these vlogs. But that is just my assumption. So I decided to verify, by opening this poll on LinkedIn  (which, by the…
Read More

Storage structures 1 – On-disk rowstore

No Comments
When a query is slow, it is often caused by inefficient access to the data. So our tuning work very frequently comes down to figuring out how data was read, and then massaging our queries or database structures to get SQL Server to access the data in a more efficient way. So we look at scans, seeks, and lookups. We know that scans are good when we access most of the data. Or, in the case of an ordered scan, to prevent having to sort the data. We know that seeks are preferred when there is a filter in the…
Read More

Self-promo: Precon opportunities

No Comments
I am normally not very good at promoting myself. I always forget to use the social media banners that conference organizes helpfully send me. And while I do have a list of upcoming speaking engagements on this site, I don’t really push it in your face at every opportunity. But the organizers of SeaQL 2026 pushed me. They asked me to record a video, to explain what attendees can expect when they sign up for my precon. And then, the fantastic Tonie Huizer went one step further, and created a YouTube short out of my promo video! The obvious next…
Read More

Problems purchasing videos?

No Comments
I started the SQLServerFast Execution Plan Video Training in 2020. At that time, I chose Vimeo as the platform to use for hosting and selling my videos. The major reason for this choice was their advertised ability to sell video access to customers across the world, so that everyone, regardless of location, can buy access to my videos and learn to read execution plans. Not in India! Two months ago, I received an email from someone who lives in India. When he tried to buy access to my videos, he received an error message: “This video is not for your…
Read More

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close