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.

What could explain that ?

Answer:

It is likely that something blocked the second query.

One common possibility is that the client application did not retrieve all the results immediately. The time taken for the client to retrieve the results is included in the duration for the query.

2026-01-07