Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
 
The Voice of the DBA
 

Imagine the Physical World

Brent Ozar has a series of database animations posts, where he tries to explain what work is done by SQL Server during certain operations, such as Index Seeks and Page Splits. These show how the engine might need to read or update various pages as it tries to perform operations. Both experienced and novice SQL Server people might think that these are interesting, but not that useful.

I think they're great.

For most of my IT career, I've drawn parallels between what I've asked the computer to do, and how this might play out in the real world if we weren't working on digital systems. Most of the constructs we have, connecting to a system, sending a query, configuring a firewall, sorting data, etc. can be related to a physical action.

If you want to understand page splits, imagine you had the index from a book printed out (or a TOC), and broken out across multiple pieces of paper. If I asked you to insert something in the middle, or to lengthen an entry that doesn't fit, what would you have to do? You'd need a new piece of paper, you'd put it in a place between the others, you'd copy over some data, you'd erase some data from existing pages and more. Exactly what Brent's animation shows.

That's real work.

The more I think about the work the computer does, even if it's measured in ms or ns, the more I can think about whether I can find an efficient way to complete my task. It's not that I mind the computer reading 1mm rows (or 100mm), but if I can reduce the work, I reduce the latency, the computer, the disk, the cost, the everything. My customers are happy when I try to reduce the work and make everything run faster.

This view has helped me look for and find better ways to implement solutions over the years. I know that not everything needs to be optimized, after all, sometimes we do more work in the physical world because of expediency, but we know the tradeoff. We can judge if it's worth it.

Too often I see people think the computer is doing the work and they dismiss the effort. It's the same attitude people have in the real world when someone else has to move/lift/pay for something. It means less to them.

Treat everything as if you had to do the work yourself. You'll treat others better and appreciate the effort spent, whether it's another human, a software program or an AI LLM. Your results will show better judgment, and hopefully, quality.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 
 Featured Contents
SQLServerCentral Article

How to Work with On-Premises AI Models to Generate T-SQL Code

Daniel Calbimonte from SQLServerCentral

See how a small local model performs on some SQL tasks. This shows how Ollama can run a model on your laptop.

Technical Article

How SQL Server maintenance becomes an attack path – and what to do about it

Additional Articles from SQLServerCentral

The article covers four connected areas: over-privileged database users, msdb and SQL Server Agent exposure, privileged maintenance jobs, and trigger-based permission hijacking.

Blog Post

From the SQL Server Central Blogs - Adding an HTTP MCP Server to VSCode

Steve Jones - SSC Editor from The Voice of the DBA

I wrote earlier this week about the SQL MCP Server using the Data API Builder. In that post I showed how to query the MCP server from VSCode, but...

Blog Post

From the SQL Server Central Blogs - Introducing azsql-migration-test: Test and Validate Azure SQL Database Migrations

MarlonRibunal from Marlon Ribunal - SQL, Code, Coffee, etc.

Introducing azsql-migration-test, a small open-source CLI that validates your Azure SQL Database migrations against a local Azure SQL Database Developer container — the same engine as the cloud, running...

Refactoring Databases cover

Refactoring Databases: Evolutionary Database Design

Site Owners from SQLServerCentral

Refactoring has proven its value in a wide range of development projects–helping software professionals improve system designs, maintainability, extensibility, and performance.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Escaping Strings

The STRING_ESCAPE() function requires 2 parameters in SQL Server 2025. The first is a string of text and the second is the type of escape rules being used. What are the options for the second parameter?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Backing Up a DMK

In SQL Server 2025, I have a database with a Database Masker Key (DMK). I want to back up this key and keep a copy offline. When do I have to open this key before running the backup?

Answer: The DMK always must be explicitly opened if it's only encrypted with a password

Explanation: The DMK always must be explicitly opened if it's only encrypted with a password. If it's encrypted with the SMK, it will automatically open. It must be open because it has to be decrypted to be backed up. Ref: Back up a database master key - https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/back-up-a-database-master-key?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


Editorials
Finding Bad Queries - Comments posted to this topic are about the item Finding Bad Queries
VACATION! - Comments posted to this topic are about the item VACATION!
Fixing P1 Queries - Comments posted to this topic are about the item Fixing P1 Queries
Building Your Own Software - Comments posted to this topic are about the item Building Your Own Software
Make It Routine - Comments posted to this topic are about the item Make It Routine
AI Observability Challenges in FinOps as a DBA - Comments posted to this topic are about the item AI Observability Challenges in FinOps as a DBA
Article Discussions by Author
Advanced T-SQL: Replacing Slow Cursors with Window Functions - Comments posted to this topic are about the item Advanced T-SQL: Replacing Slow Cursors with Window Functions
The Service Name - Comments posted to this topic are about the item The Service Name
Why SQL Server Database Attach fails and how to repair it - Comments posted to this topic are about the item Why SQL Server Database Attach fails and how to repair it
BIT_COUNT() IV - Comments posted to this topic are about the item BIT_COUNT() IV
Symmetric Key Encryption - Comments posted to this topic are about the item Symmetric Key Encryption
The “Successful Login” Dilemma: Why Your Login Auditing Strategy Might Be Hurting Your Server - Comments posted to this topic are about the item The “Successful Login” Dilemma: Why Your Login Auditing Strategy Might Be Hurting Your Server
DBCC CHECKDB Limits III - Comments posted to this topic are about the item DBCC CHECKDB Limits III
CROSS APPLY Fundamentals: Part 1 - Comments posted to this topic are about the item CROSS APPLY Fundamentals: Part 1
SQL Server 2022 - Development
iso source of scripts. - While doing some housekeeping I came across a folder containing some scripts that appear to be for a transaction log alert system. Now all scripts except one obviously were generated by SSMS which indicates I didn't save the original scripts or I did this project from a video and wanted to save everything before I […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -