Azure-Sql-Db

SQL: Common Anti-Patterns that Stop Parallelism

SQL: Common Anti-Patterns that Stop Parallelism

One of SQL Server’s greatest strengths is its ability to execute queries in parallel. When parallelism is available, the engine can divide work across multiple CPU cores and dramatically reduce query duration for large or complex workloads.

Yet in real systems, it’s surprisingly common to find queries that could run in parallel but don’t. The reason is often not hardware, configuration, or cost threshold settings — but query anti-patterns that quietly force the optimizer into a serial plan.

2026-01-26

Data Tales 13: The case of the invisible brake

Data Tales 13: The case of the invisible brake

This is the thirteenth tale in a series of stories about data. I hope you enjoy the series.

Today’s tale relates to a SQL Server system that had wonderful hardware, yet was unbelievably slow. Let’s discuss what happened.

Some background information

I had a call from the Microsoft office in Brisbane, Queensland, asking if I had time to look at a problem at a customer site. Both they, and the customer, had thrown considerable resources at trying to resolve a performance problem, but frustratingly, it persisted.

2026-01-24

SQL Interview: 104 Backup restore time

SQL Interview: 104 Backup restore time

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Advanced

Question:

A database backup was started at 12:00 PM. It completed at 2:00 PM.

When the backup is restored, at what time point will the restored data be?

  • 12:00 PM
  • 2:00 PM
  • Somewhere between 12:00 PM and 2:00 PM

Answer:

2026-01-20

SQL Interview: 112 Trigger and constraint execution order

SQL Interview: 112 Trigger and constraint execution order

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Medium

Question:

You have tables that have both constraints and triggers. You need to explain the order of execution for these. Which execution order (from first to last), are used for:

  • Check constraints
  • After triggers
  • Instead of triggers

Answer:

2026-01-18

SQL Interview: 111 Simple recovery and log truncation

SQL Interview: 111 Simple recovery and log truncation

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Advanced

Question:

If a database is configured for simple recovery model, what could stop the truncation of the transaction log being effective, and for the transaction log to keep growing in size?

Answer:

Here are the most frequent reasons:

2026-01-16

SQL Interview: 110 Long restores and restarts

SQL Interview: 110 Long restores and restarts

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Intro

Question:

You are restoring a database backup. The restore finished reading pages 10 minutes ago, but the database still shows that it is restoring.

Can you speed up the restoring phase by restarting the server? If so, should you do that? If not, why not?

2026-01-14

SQL Interview: 109 Simple recovery and logging

SQL Interview: 109 Simple recovery and logging

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Intro

Question:

You have a database configured for simple recovery model. You notice that the transaction log is still increasing in size.

What could cause this?

Answer:

Even in the Simple recovery model, it is quite normal to see the transaction log file grow. That does not necessarily mean it’s stuck or misconfigured.

2026-01-12

SQL Interview: 108 Increasing memory consumption

SQL Interview: 108 Increasing memory consumption

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Medium

Question:

You are reviewing the memory usage of a Windows Server running SQL Server. It appears to have almost run out of memory.

You add additional memory, and monitor the usage of the memory by SQL Server. It appears to always be constantly increasing, until the server is almost out of memory again.

2026-01-10

SQL Interview: 107 Timestamp data type and time

SQL Interview: 107 Timestamp data type and time

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Intro

Question:

You are reviewing the design of a database and note that in the dbo.Customers table, there is a column called CustomerTimestamp that has the timestamp data type.

Can you extract the date from the CustomerTimestamp column by using the CONVERT function?

2026-01-08

SQL Interview: 100 Query duration vs execution plan cost

SQL Interview: 100 Query duration vs execution plan cost

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Medium

Question:

You are tracing queries using Extended Events. Two queries have exactly the same execution plan, and the same plan costs. In the trace, one query showed a duration of 2 minutes. The other query showed a duration of over an hour.

2026-01-07