Optimized Locking part 2: Lock After Qualification

No Comments
SQL Server 2025 introduced Optimized Locking. Not one, but two features, sharing a single marketing name. Lock After Qualification (LAQ) One of these two features is Lock After Qualification (LAQ). This feature avoids the scenario where a delete or update is blocked by a locked row that would not qualify. But, like any good thing, there is a price. This video shows the feature, explains how it works, and shows some of the potentially undesired side effects. More of me? Was this useful to you? Do you want to learn more from me? You can click here to see an…
Read More

Video training update

No Comments
My training videos in the SQLServerFast Execution Plan Video Training are never just a done deal. Whenever there is new information to share, either because Microsoft adds new functionality, or because I discover something I did not know before, I go back and add this new information to the appropriate videos. Any such update always comes free of charge to those who bought access to the videos. Once you have access, you can watch these videos as often as you like. And you will always see the latest and greatest version! So it makes sense to stay updated on those…
Read More
Photo of Hugo Kornelis presenting at a conference

Precon, precon, precon

No Comments
If you read this blog, then it is very likely that you have an interest in execution plans. And that you want to increase your understanding of execution plans. A great way to really get to the next level is to attend a precon about execution plans, to get a full day of training on this topic. Another option is to purchase access to the SQLServerFast Execution Plan Video Training, currently over 20 hours of video with very extensive and in-depth training on execution plans. The best option is of course to combined the two: attend a precon, and get…
Read More

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

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