You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SQL Server Query Store总时长数值偏高问题咨询

Understanding Query Store's total duration in Your Scenario

Great question—this is a super common point of confusion when digging into Query Store metrics, so let’s break this down clearly:

Is total duration counted per thread?

Nope, it’s not tracked on a per-thread basis. Instead, total duration is the sum of wall-clock time for every single execution of every query captured by Query Store during your 60-minute workload.

To put it plainly: every time a query runs from start to finish, Query Store logs how long that specific run took (the actual time that passed on a clock for that execution), and adds that value to the total duration tally (whether you’re looking at an individual query or the overall resource consumption view).

Why does the total add up to 25 hours when your workload only ran for 60 minutes?

This is totally normal, and it all comes down to how SQL Server handles parallel and concurrent workloads:

  • During your 60-minute window, your server wasn’t running just one query at a time. It was likely processing multiple queries simultaneously, or repeating the same query many times over.
  • For example: if in one minute, your server runs 25 separate queries that each take 1 minute to complete (all running in parallel), the total duration for that minute would be 25 minutes. Multiply that over 60 minutes, and you end up with 1500 minutes (25 hours) total—even though only 60 minutes of real time passed.
  • This metric is designed to show you the total amount of time resources consumed by all your queries combined, not to match the actual elapsed time of your workload.

Quick tip for better context

If you want metrics that align more closely with real-world elapsed time, you can check Query Store’s active time (which tracks how much time queries were actively using resources, accounting for parallelism) or filter down to individual queries to compare their average execution time against how many times they ran.

内容的提问来源于stack exchange,提问作者DbForumGuy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:26:58