Month: June 2024

Plansplaining part 32 – Keyset cursors

Welcome to plansplaining, part 32, where we once more look at cursors. We already discussed the basics, and looked at static cursors and dynamic cursors. It is now time to cast our gaze upon the keyset cursor. The keyset cursor is sort of in between the static cursor (which presents a snapshot of the data is at was when the cursor was opened and disregards future changes) and the dynamic cursor (that always shows the current data). To be precise, a keyset cursor sees changes made to already existing rows, but does not see new rows that were added after…

Execution plan training around the world

I sometimes hear that query performance tuning is a dying skill. But that is not true! Even in the modern day, with workloads moving to the cloud where you can increase performance by just moving a slider, where a lot of work is done by data analysts, using low-code or no-code solutions with an abstracted view of the data model, and where investments by Microsoft have taught SQL Server how to automatically improve performance in many ways, there is still a need for professionals who know how to investigate and fix a performance problem. Perhaps that need is even growing!…

Plansplaining part 31 – Dynamic cursors

We’re already at part 31 of the plansplaining series. And this is also the third part in my discussion of execution plans for cursors. After explaining the basics, and after diving into static cursors, it is now time to investigate dynamic cursors. As a quick reminder, recall that a static cursor presents data as it was when the cursor was opened (and does so by simply saving a snapshot of that data in tempdb), whereas a dynamic cursor is supposed to see all changes that are committed while the cursor is open. Let’s see how this change in semantics affects…

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