Pinned Tweet
SQL Server is changing.

AI is changing how we work with databases.

I spend my time exploring where the two meet.

Here you will find:

SQL Server performance tuning
Query tuning and troubleshooting
Practical AI ideas for DBAs
Real-world scripts and demos
Lessons from actual performance problems

No hype. No fluff.

Just practical learning around SQL Server, performance, and AI.

Follow if that is your kind of content.
1
1
37
11,045
The Halloween Server Shadow: Spot the Impossible One

The Halloween server shadow puzzle has three servers and one impossible cable. Which shadow does not belong?

I promised myself that a Sunday puzzle in the week before Halloween could be a little theatrical. So the servers , and the cables are casting long, suspicious shadows. Nothing is broken in this server room. The drama is in one mismatched outline.

Look at cabinets A, B and C across the top. Each has a short cable that bends away from its side. The shapes beneath are their supposed shadows. Which shadow could not have come from the cabinet directly above it? The racks have the same plain body, so follow the little cable and ignore the three horizontal slots on the front.

This is a matching puzzle, not a test of how real light would fall in a data centre. Treat each shadow as a flat silhouette of the rack above it. One cable changes sides. If you see it quickly, you have earned the rest of your Sunday.

blog.sqlauthority.com/2026/10/25/hal…
0
0
0
392
The Query Optimizer Interview: Twenty Minutes, No Hints

It works in a room with no windows and no clock, and it has never once been thanked. Every query you have ever run passed across its desk. It decided, in a few milliseconds, how your data would be found. Then it threw away the reasoning and kept the verdict.

It agreed to meet on a 500,000 row table of customers. Ninety percent of them are in Norvantia, 9.9 percent in Calderia, and five are in Vantorra. The countries are invented. The shape of the data is not, and yours looks like this too.

On Ignoring Your Index

You had an index on Country. Somebody asked for the customers in Calderia and you ignored it. Why?

I did not ignore it. I priced it.

You scanned 500,000 rows to find 49,500.

Your index holds Country and the key. The query asked for a column I do not keep there. So the index gets me a list of addresses. Then I visit every one of them to fetch the rest of the row.

Forty nine thousand visits.

Forty nine thousand five hundred. Each one lands on a page I may have to fetch. Reading the table start to finish is one sweep in order. At that number it wins, and it is not close.

Read more: blog.sqlauthority.com/2026/10/21/que…
0
0
1
885
Welcome to the SQL Advisor, where the answer is never “it depends” unless I tell you what it depends on. Seven letters this time. Every answer carries a number I took myself.

Read more: blog.sqlauthority.com/2026/10/19/sql…
0
0
0
654
Deadlock or just a queue? Three sessions are waiting. Name the two stuck together without blaming the third. Learnto Code

A waiting session is not automatically a deadlock. That distinction matters when the phone rings and everyone is looking at a diagram with too many arrows. n as the session ahead finishes. A deadlock is different: the waiting forms a cycle.

In the picture, teal arrows mean HOLDS and red arrows mean WAITS FOR. Session A holds resource X and wants Y. Session B holds Y and wants X. Session C wants X but holds neither resource in this drawing. Look at the arrows and ask which sessions would remain stuck if nobody intervened. Take a moment before you read the answer; the extra session is there to make you work a little.

The labels are deliberately simple. There is no hidden isolation level or lock mode to guess. This is a graph puzzle about the shape of the wait, not a complete SQL Server deadlock report.
1
0
1
792
Replying to @pinaldave
0
0
0
209
Pinal Dave retweeted
Reverse engineer any app for free

A free, open-source tool called REA already has 100,000 GitHub stars.

Plug it into your AI agent, point it at any app,and it tells you exactly how a feature works, even without the source code.
And it runs on your machine, so nothing gets his slow TV open apps in 3 seconds instead of 30.

Another got AirDrop on Linux. Work that needed a team is now a prompt.
11
11
102
7,149
Are companies still hiring junior developers?

Every job posting seems to ask for 3–5 years of experience. If nobody wants to hire fresh talent, where are developers supposed to get that experience?

Genuinely curious. Are junior developer roles disappearing? 🤔
1
0
8
1,706
AI in Production Without a WHERE Clause
0
0
8
1,494
Wait types are the most misread numbers in SQL Server. So I caused six of them on purpose, one at a time. I took a profile of each while it was happening.

The lab is one table of 2.5 million rows, about 1.15 gigabytes, on SQL Server 2025. Every figure below is the wait recorded for my own session while the workload ran, not a server total. Where a wait behaved differently from its reputation, I have said so rather than tidied it away.

Each section carries a profile card with the reading of that wait. The measurements stay in the text, where they can keep the conditions they were taken under.

One number to hold in your head before we start. A lock wait in this lab cost 81,927 milliseconds across a single wait. A processor wait in the same lab cost 3 milliseconds across 398 waits.

Sorted by count and sorted by time, a wait list gives you two different answers. Only one of them is about your problem.

Read more here: blog.sqlauthority.com/2026/10/16/wai…
0
1
2
886
I have built very interesting new demos for it!
A query rewrite from AI.

An execution plan with questions.

A DBA who has seen this sort of thing before.

Pinal Dave digs into AI-assisted SQL tuning with real examples on Oct 22.

🦆 attendee.gotowebinar.com/register/78731…

#SQLServer #DBA
0
0
4
866
A wrong answer from AI sounds exactly like a right one.

Confidence is not evidence. It is a writing style the model learned.

Try it: ask your assistant for the email column in AdventureWorks Sales.Customer. There isn't one. Watch what it does.

blog.sqlauthority.com/2026/10/15/why…
1
0
2
987
A customer asked a six-person team why their large invoices were billed slightly differently.

The answer was a four-line rounding rule. The person who wrote it had left eight months earlier.

The team asked their AI assistant. It explained the code perfectly and even offered a cleaner version. What it could not tell them was why the rule existed. It might have been a regulatory requirement, or a promise to a big customer. It might have been a workaround for a system shut down in 2021, or just a mistake nobody had noticed.

They left the code alone and told the customer the invoice was correct. That was true. Nobody in the company could say why it was true.

This is tribal knowledge, and AI makes losing it easier to miss. New engineers used to text the person who left. Now they ask the assistant, get a good answer about what the code does, and feel caught up. The old failure was loud. The new one feels like competence.

Two things that actually help:

1. 𝗔 𝗱𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝗹𝗼𝗴 𝗶𝗻 𝘁𝗵𝗲 𝗿𝗲𝗽𝗼, 𝗻𝗲𝘅𝘁 𝘁𝗼 𝘁𝗵𝗲 𝗰𝗼𝗱𝗲. Four lines per decision: the choice, the alternative, the reason, and what would make this wrong. The last line matters most, because it tells the next person when they can safely undo it.

2. 𝗢𝗻𝗲 𝗿𝗲𝗰𝗼𝗿𝗱𝗲𝗱 𝗵𝗼𝘂𝗿 𝗯𝗲𝗳𝗼𝗿𝗲 𝘀𝗼𝗺𝗲𝗼𝗻𝗲 𝗹𝗲𝗮𝘃𝗲𝘀. Skip the exit doc. Ask them: what breaks if a new person makes the obvious change? What looks wrong but is right? What failed before? Which customer deals live in no document?

The code is not the knowledge. It is the leftovers of a decision nobody wrote down.

Start the log this week. Then go ask your longest-serving person why things work the way they do.

Full post: blog.sqlauthority.com/2026/10/12/tri…

#SQLServer #DataEngineering #AI #EngineeringLeadership
0
1
1
895
Please join
On October 22, @pinaldave is putting generative AI to the test with real SQL Server examples in a practical, demo-driven session.

Where AI helps, where it gets things wrong, and how to use it alongside proven tuning techniques.

🦆 Join us at 10 AM CT: attendee.gotowebinar.com/register/78731…

#SQLServer #DBA
1
0
3
964
Pinal Dave retweeted
Replying to @Idera_Software
On October 22, @pinaldave is putting generative AI to the test with real SQL Server examples in a practical, demo-driven session.

Where AI helps, where it gets things wrong, and how to use it alongside proven tuning techniques.

🦆 Join us at 10 AM CT: attendee.gotowebinar.com/register/78731…

#SQLServer #DBA
0
1
2
1,053
AI Sounds Like Someone, But Nobody Is in There
blog.sqlauthority.com/2026/10/10/ai-…
0
0
0
994
The Promise Arrived Before the Machine

Ask your data a question in plain English. That sentence has been sold to executives since the nineties. Every reporting product shipped a version of it, and every version was quietly retired.

Each time it failed, we blamed the ears. The machine couldn’t understand the question, which was fair, because it couldn’t.

So the promise sat on a shelf for two decades, waiting for hardware that could keep it. That excuse has now expired. Ask for the top ten customers by revenue last quarter, excluding internal accounts, and you get correct, well written SQL.

We finally ran the experiment we’d been unable to run. And we found out the question was never the hard part.

blog.sqlauthority.com/2026/10/09/tex…
0
0
2
1,010
Tokens and the Context Window: Out of the Window, Out of Mind

Part two of ten. Most of the surprises people hit with AI at work trace back to this one chapter. A model reads in tokens, holds only so many at once, and charges for each one.

1. What is a token?A token is the unit of text a model reads and writes. It can be a whole word, part of a word, a chunk of a number or a punctuation mark. For common English text, a rough rule is about four characters per token.Why it matters. Tokens are how models are measured and billed. Context limits, prices and speed are all counted in tokens. Code and SQL use more tokens than you’d guess, because a name like SalesOrderDetailID splits into several pieces.

Read more about it: blog.sqlauthority.com/2026/10/08/tok…
0
0
3
768
Interesting...Sent by ChatGPT from another task
0
0
0
1,018